{"action":"created","issue":{"url":"https://api.github.com/repos/ankane/ahoy/issues/379","repository_url":"https://api.github.com/repos/ankane/ahoy","labels_url":"https://api.github.com/repos/ankane/ahoy/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/ankane/ahoy/issues/379/comments","events_url":"https://api.github.com/repos/ankane/ahoy/issues/379/events","html_url":"https://github.com/ankane/ahoy/issues/379","id":362063302,"node_id":"MDU6SXNzdWUzNjIwNjMzMDI=","number":379,"title":"ahoy.reset() doesn't seem to work","user":{"login":"ndbroadbent","id":139536,"node_id":"MDQ6VXNlcjEzOTUzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/139536?v=4","gravatar_id":"","url":"https://api.github.com/users/ndbroadbent","html_url":"https://github.com/ndbroadbent","followers_url":"https://api.github.com/users/ndbroadbent/followers","following_url":"https://api.github.com/users/ndbroadbent/following{/other_user}","gists_url":"https://api.github.com/users/ndbroadbent/gists{/gist_id}","starred_url":"https://api.github.com/users/ndbroadbent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndbroadbent/subscriptions","organizations_url":"https://api.github.com/users/ndbroadbent/orgs","repos_url":"https://api.github.com/users/ndbroadbent/repos","events_url":"https://api.github.com/users/ndbroadbent/events{/privacy}","received_events_url":"https://api.github.com/users/ndbroadbent/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-20T07:58:24Z","updated_at":"2018-09-20T08:29:36Z","closed_at":"2018-09-20T08:29:36Z","author_association":"NONE","body":"I rolled back my database and reran the migrations. Then I ran `ahoy.reset()` on the frontend. I reloaded the page and called `binding.pry` in my index action, and checked the value of `current_visit`:\r\n\r\n```\r\n> current_visit\r\n  Ahoy::Visit Load (2.1ms)  SELECT  \"ahoy_visits\".* FROM \"ahoy_visits\" WHERE \"ahoy_visits\".\"visit_token\" = $1 ORDER BY \"ahoy_visits\".\"id\" ASC LIMIT $2  [[\"visit_token\", \"1e0a9cec-5d3c-4608-9899-f44eac357484\"], [\"LIMIT\", 1]]\r\n  ↳ (pry):2\r\n=> nil\r\n```\r\n\r\nNot sure where the `visit_token` is coming from and why it's not being cleared. But it also might be a good idea to check for `nil` and recreate any missing visits.\r\n\r\nThis might be because I'm using `Ahoy.cookie_domain = :all` and was running `ahoy.reset()` on a subdomain. But I also ran it on the root domain, and a new visit is still not being created.\r\n\r\nNote: This is in Firefox."},"comment":{"url":"https://api.github.com/repos/ankane/ahoy/issues/comments/423091808","html_url":"https://github.com/ankane/ahoy/issues/379#issuecomment-423091808","issue_url":"https://api.github.com/repos/ankane/ahoy/issues/379","id":423091808,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzA5MTgwOA==","user":{"login":"ndbroadbent","id":139536,"node_id":"MDQ6VXNlcjEzOTUzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/139536?v=4","gravatar_id":"","url":"https://api.github.com/users/ndbroadbent","html_url":"https://github.com/ndbroadbent","followers_url":"https://api.github.com/users/ndbroadbent/followers","following_url":"https://api.github.com/users/ndbroadbent/following{/other_user}","gists_url":"https://api.github.com/users/ndbroadbent/gists{/gist_id}","starred_url":"https://api.github.com/users/ndbroadbent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndbroadbent/subscriptions","organizations_url":"https://api.github.com/users/ndbroadbent/orgs","repos_url":"https://api.github.com/users/ndbroadbent/repos","events_url":"https://api.github.com/users/ndbroadbent/events{/privacy}","received_events_url":"https://api.github.com/users/ndbroadbent/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T08:29:36Z","updated_at":"2018-09-20T08:29:36Z","author_association":"NONE","body":"Fixed by #380"}}
{"actor":{"display_login":"ndbroadbent"}}