{"action":"created","issue":{"url":"https://api.github.com/repos/azukiapp/azk/issues/398","labels_url":"https://api.github.com/repos/azukiapp/azk/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/azukiapp/azk/issues/398/comments","events_url":"https://api.github.com/repos/azukiapp/azk/issues/398/events","html_url":"https://github.com/azukiapp/azk/issues/398","id":75323104,"number":398,"title":"User permission to be tracked is double checked by azk.Tracker and InsightKeenIO module","user":{"login":"marcusgadbem","id":254129,"avatar_url":"https://avatars.githubusercontent.com/u/254129?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusgadbem","html_url":"https://github.com/marcusgadbem","followers_url":"https://api.github.com/users/marcusgadbem/followers","following_url":"https://api.github.com/users/marcusgadbem/following{/other_user}","gists_url":"https://api.github.com/users/marcusgadbem/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusgadbem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusgadbem/subscriptions","organizations_url":"https://api.github.com/users/marcusgadbem/orgs","repos_url":"https://api.github.com/users/marcusgadbem/repos","events_url":"https://api.github.com/users/marcusgadbem/events{/privacy}","received_events_url":"https://api.github.com/users/marcusgadbem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/azukiapp/azk/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"marcusgadbem","id":254129,"avatar_url":"https://avatars.githubusercontent.com/u/254129?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusgadbem","html_url":"https://github.com/marcusgadbem","followers_url":"https://api.github.com/users/marcusgadbem/followers","following_url":"https://api.github.com/users/marcusgadbem/following{/other_user}","gists_url":"https://api.github.com/users/marcusgadbem/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusgadbem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusgadbem/subscriptions","organizations_url":"https://api.github.com/users/marcusgadbem/orgs","repos_url":"https://api.github.com/users/marcusgadbem/repos","events_url":"https://api.github.com/users/marcusgadbem/events{/privacy}","received_events_url":"https://api.github.com/users/marcusgadbem/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-05-11T18:57:37Z","updated_at":"2015-05-11T22:03:19Z","closed_at":null,"body":"There is a double check wether user has opted to be tracked or not in despite of the answer and both are not in sync.\r\n\r\nA few things to observe:\r\n\r\n* User permission is first checked at [azk/src/utils/tracker.js#L54](https://github.com/azukiapp/azk/blob/master/src%2Futils%2Ftracker.js#L54) and then in [insight-keen-io/lib/index.js#L107-L109](https://github.com/azukiapp/insight-keen-io/blob/master/lib/index.js#L107-L109)\r\n* `azk.Tracker.savePermission()` stores user input inside own `azk.Meta` and do not share it with InsightKeenIO module\r\n* InsightKeenIO has his [own store system](https://github.com/azukiapp/insight-keen-io/blob/master/lib/index.js#L49-L56) using `configstore` and defaults `optOut` to `false`\r\n\r\nI think this can be fixed by changing `azk.Tracker.saveTrackerPermission(answer)` to share answer with InsightKeenIO by adding this line:\r\n\r\n```javascript\r\nthis.insight.optOut = !answer;\r\n```\r\n\r\nThe result will be:\r\n\r\n```javascript\r\nsaveTrackerPermission(answer) {\r\n\t// we should negativate the answer because tracker \r\n\t// works with 'optIn' and insight-keen-io works with 'optOut'\r\n\tthis.insight.optOut = !answer;\r\n    return azkMeta.set(this.ids_keys.permission, answer);\r\n}\r\n```\r\n\r\nI'll make some tests to assure it and then make the PR."},"comment":{"url":"https://api.github.com/repos/azukiapp/azk/issues/comments/101061408","html_url":"https://github.com/azukiapp/azk/issues/398#issuecomment-101061408","issue_url":"https://api.github.com/repos/azukiapp/azk/issues/398","id":101061408,"user":{"login":"saitodisse","id":155953,"avatar_url":"https://avatars.githubusercontent.com/u/155953?v=3","gravatar_id":"","url":"https://api.github.com/users/saitodisse","html_url":"https://github.com/saitodisse","followers_url":"https://api.github.com/users/saitodisse/followers","following_url":"https://api.github.com/users/saitodisse/following{/other_user}","gists_url":"https://api.github.com/users/saitodisse/gists{/gist_id}","starred_url":"https://api.github.com/users/saitodisse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saitodisse/subscriptions","organizations_url":"https://api.github.com/users/saitodisse/orgs","repos_url":"https://api.github.com/users/saitodisse/repos","events_url":"https://api.github.com/users/saitodisse/events{/privacy}","received_events_url":"https://api.github.com/users/saitodisse/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T22:03:19Z","updated_at":"2015-05-11T22:03:19Z","body":"Hello, @marcusgadbem. This verification is made by azk now. We are not using this insight feature anymore. I think that you can remove this verification from `insight-keen-io`."}}