{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments/288567032","pull_request_review_id":243260191,"id":288567032,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4ODU2NzAzMg==","diff_hunk":"@@ -0,0 +1,27 @@\n+# Internal behavior\n+\n+## Clearing metrics when disabling/enabling Glean\n+\n+When disabling upload (`Glean.setUploadEnabled(false)`), metrics are also\n+cleared to prevent their storage on the local device, and lessen the likelihood\n+of accidentally sending them.  There are a couple of exceptions to this:\n+\n+- `first_run_date` is retained so it isn't reset if metrics are later re-enabled.\n+\n+- `client_id` is set to the special value\n+  `\"c0ffeec0-ffee-c0ff-eec0-ffeec0ffeec0\"`. This should make it possible to\n+  detect the error case when metrics are sent from a client that has been disabled.\n+  \n+When re-enabling metrics:\n+\n+- `first_run_date` is left as-is. (It should remain a correct date of first run\n+  of the application, unaffected by disabling/enabling Glean).\n+\n+- `client_id` is regenerated. It has no connection to the `client_id` used prior\n+  to disabling Glean.\n+  \n+- Application lifetime metrics owned by Glean are regenerated from scratch so","path":"components/service/glean/docs/internal.md","position":23,"original_position":23,"commit_id":"a8bc9ad2e5bcc73f1a800bea14ccd2d196740758","original_commit_id":"a8bc9ad2e5bcc73f1a800bea14ccd2d196740758","user":{"login":"mdboom","id":38294,"node_id":"MDQ6VXNlcjM4Mjk0","avatar_url":"https://avatars3.githubusercontent.com/u/38294?v=4","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"body":"They would just naturally be set next time they are recorded (as per normal operation of glean from a fresh restart).  Worth adding a sentence about that, though.","created_at":"2019-05-29T13:30:05Z","updated_at":"2019-05-29T13:30:05Z","html_url":"https://github.com/mozilla-mobile/android-components/pull/2838#discussion_r288567032","pull_request_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments/288567032"},"html":{"href":"https://github.com/mozilla-mobile/android-components/pull/2838#discussion_r288567032"},"pull_request":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838"}},"in_reply_to_id":288539521},"pull_request":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838","id":273246226,"node_id":"MDExOlB1bGxSZXF1ZXN0MjczMjQ2MjI2","html_url":"https://github.com/mozilla-mobile/android-components/pull/2838","diff_url":"https://github.com/mozilla-mobile/android-components/pull/2838.diff","patch_url":"https://github.com/mozilla-mobile/android-components/pull/2838.patch","issue_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/2838","number":2838,"state":"open","locked":false,"title":"1513616: Clear metrics when telemetry is disabled.","user":{"login":"mdboom","id":38294,"node_id":"MDQ6VXNlcjM4Mjk0","avatar_url":"https://avatars3.githubusercontent.com/u/38294?v=4","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"body":"This follows the requirements @georgf listed in the bug:\r\n\r\nThe expectation on Desktop is, that on disabling Telemetry (code):\r\n\r\n-    That we set the client id to a known value.\r\n-    That we discard all pending pings.\r\n-    We stop all uploading of pings.\r\n-    That we reset all metrics (Desktop only resets some actually?). (Some exceptions might apply for Glean, like not resetting say install date?)\r\n-    That we send a last optout ping, which contains no client id  **this is not implemented in this PR -- saving for a follow-up**\r\n\r\nOn re-enabling Telemetry, we:\r\n\r\n-    Set the client id to a new UUID (this i think is a policy requirement).\r\n-    Start freshly recording metrics again (implementation dependent: either reset one more time or stop discarding recorded values).\r\n\r\n\r\n### Pull Request checklist\r\n<!-- Before submitting the PR, please address each item -->\r\n- [x] **Quality**: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)\r\n- [x] **Tests**: This PR includes thorough tests or an explanation of why it does not\r\n- [x] **Changelog**: This PR includes [a changelog entry](https://github.com/mozilla-mobile/android-components/blob/master/docs/changelog.md) or does not need one\r\n- [ ] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features\r\n","created_at":"2019-04-24T18:17:21Z","updated_at":"2019-05-29T13:30:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fa74020cc47e4d6e20c93b7790ee84150e77291","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1091481880,"node_id":"MDU6TGFiZWwxMDkxNDgxODgw","url":"https://api.github.com/repos/mozilla-mobile/android-components/labels/%3Cglean%3E","name":"<glean>","color":"cdcdcd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838/commits","review_comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838/comments","review_comment_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/2838/comments","statuses_url":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/a8bc9ad2e5bcc73f1a800bea14ccd2d196740758","head":{"label":"mdboom:clear-metrics-on-disable","ref":"clear-metrics-on-disable","sha":"a8bc9ad2e5bcc73f1a800bea14ccd2d196740758","user":{"login":"mdboom","id":38294,"node_id":"MDQ6VXNlcjM4Mjk0","avatar_url":"https://avatars3.githubusercontent.com/u/38294?v=4","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"repo":{"id":154378599,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQzNzg1OTk=","name":"android-components","full_name":"mdboom/android-components","private":false,"owner":{"login":"mdboom","id":38294,"node_id":"MDQ6VXNlcjM4Mjk0","avatar_url":"https://avatars3.githubusercontent.com/u/38294?v=4","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mdboom/android-components","description":"A collection of Android libraries to build browsers or browser-like applications.","fork":true,"url":"https://api.github.com/repos/mdboom/android-components","forks_url":"https://api.github.com/repos/mdboom/android-components/forks","keys_url":"https://api.github.com/repos/mdboom/android-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdboom/android-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdboom/android-components/teams","hooks_url":"https://api.github.com/repos/mdboom/android-components/hooks","issue_events_url":"https://api.github.com/repos/mdboom/android-components/issues/events{/number}","events_url":"https://api.github.com/repos/mdboom/android-components/events","assignees_url":"https://api.github.com/repos/mdboom/android-components/assignees{/user}","branches_url":"https://api.github.com/repos/mdboom/android-components/branches{/branch}","tags_url":"https://api.github.com/repos/mdboom/android-components/tags","blobs_url":"https://api.github.com/repos/mdboom/android-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdboom/android-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdboom/android-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdboom/android-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdboom/android-components/statuses/{sha}","languages_url":"https://api.github.com/repos/mdboom/android-components/languages","stargazers_url":"https://api.github.com/repos/mdboom/android-components/stargazers","contributors_url":"https://api.github.com/repos/mdboom/android-components/contributors","subscribers_url":"https://api.github.com/repos/mdboom/android-components/subscribers","subscription_url":"https://api.github.com/repos/mdboom/android-components/subscription","commits_url":"https://api.github.com/repos/mdboom/android-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdboom/android-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdboom/android-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdboom/android-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdboom/android-components/contents/{+path}","compare_url":"https://api.github.com/repos/mdboom/android-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdboom/android-components/merges","archive_url":"https://api.github.com/repos/mdboom/android-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdboom/android-components/downloads","issues_url":"https://api.github.com/repos/mdboom/android-components/issues{/number}","pulls_url":"https://api.github.com/repos/mdboom/android-components/pulls{/number}","milestones_url":"https://api.github.com/repos/mdboom/android-components/milestones{/number}","notifications_url":"https://api.github.com/repos/mdboom/android-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdboom/android-components/labels{/name}","releases_url":"https://api.github.com/repos/mdboom/android-components/releases{/id}","deployments_url":"https://api.github.com/repos/mdboom/android-components/deployments","created_at":"2018-10-23T18:35:53Z","updated_at":"2019-04-11T11:27:27Z","pushed_at":"2019-05-29T10:58:13Z","git_url":"git://github.com/mdboom/android-components.git","ssh_url":"git@github.com:mdboom/android-components.git","clone_url":"https://github.com/mdboom/android-components.git","svn_url":"https://github.com/mdboom/android-components","homepage":"https://mozilla-mobile.github.io/android-components/","size":49563,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-mobile:master","ref":"master","sha":"8d88f0628afabedf70e689d227c13548d15dc881","user":{"login":"mozilla-mobile","id":22351667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzUxNjY3","avatar_url":"https://avatars3.githubusercontent.com/u/22351667?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":126199585,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYxOTk1ODU=","name":"android-components","full_name":"mozilla-mobile/android-components","private":false,"owner":{"login":"mozilla-mobile","id":22351667,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzUxNjY3","avatar_url":"https://avatars3.githubusercontent.com/u/22351667?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mozilla-mobile/android-components","description":"A collection of Android libraries to build browsers or browser-like applications.","fork":false,"url":"https://api.github.com/repos/mozilla-mobile/android-components","forks_url":"https://api.github.com/repos/mozilla-mobile/android-components/forks","keys_url":"https://api.github.com/repos/mozilla-mobile/android-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-mobile/android-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-mobile/android-components/teams","hooks_url":"https://api.github.com/repos/mozilla-mobile/android-components/hooks","issue_events_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-mobile/android-components/events","assignees_url":"https://api.github.com/repos/mozilla-mobile/android-components/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-mobile/android-components/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-mobile/android-components/tags","blobs_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-mobile/android-components/languages","stargazers_url":"https://api.github.com/repos/mozilla-mobile/android-components/stargazers","contributors_url":"https://api.github.com/repos/mozilla-mobile/android-components/contributors","subscribers_url":"https://api.github.com/repos/mozilla-mobile/android-components/subscribers","subscription_url":"https://api.github.com/repos/mozilla-mobile/android-components/subscription","commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-mobile/android-components/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-mobile/android-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-mobile/android-components/merges","archive_url":"https://api.github.com/repos/mozilla-mobile/android-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-mobile/android-components/downloads","issues_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-mobile/android-components/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-mobile/android-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-mobile/android-components/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-mobile/android-components/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-mobile/android-components/deployments","created_at":"2018-03-21T15:24:03Z","updated_at":"2019-05-29T13:10:09Z","pushed_at":"2019-05-29T13:17:56Z","git_url":"git://github.com/mozilla-mobile/android-components.git","ssh_url":"git@github.com:mozilla-mobile/android-components.git","clone_url":"https://github.com/mozilla-mobile/android-components.git","svn_url":"https://github.com/mozilla-mobile/android-components","homepage":"https://mozac.org","size":49430,"stargazers_count":805,"watchers_count":805,"language":"Kotlin","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":152,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":446,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":152,"open_issues":446,"watchers":805,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838"},"html":{"href":"https://github.com/mozilla-mobile/android-components/pull/2838"},"issue":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/issues/2838"},"comments":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/issues/2838/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/2838/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/a8bc9ad2e5bcc73f1a800bea14ccd2d196740758"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mdboom"}}