{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa/pulls/comments/47770124","id":47770124,"diff_hunk":"@@ -0,0 +1,84 @@\n+# Push Notifications for Account Status Changes\n+\n+https://mozilla.aha.io/features/FXA-54\n+\n+## Stories\n+\n+As a user signed in to an FxA connected device,\n+I want my device to update its UI in a timely manner\n+when I interact with my account from other devices.\n+\n+As a developer of client code for a connected device,\n+I want to easily receive notifications so that I can\n+respond to account status changes without resorting to\n+polling the server.\n+\n+As a developer of Firefox Accounts,\n+I want to stop Firefox from polling for account verification\n+because this is the single biggest source\n+of system load in production.\n+\n+## Success Criteria\n+\n+This feature will be successful if\n+we successfully eliminate polling for account verification\n+from the browser code on Desktop and Fennec.\n+\n+As a concrete metric\n+we can measure the time between account verification\n+and the use of a keyFetchToken by the browser,\n+an action that it will only perform\n+when it knows the account has been verified.\n+\n+## Details\n+\n+When FxA-45 lands,\n+connected devices will be able to register a push API endpoint\n+to receive notifications from the FxA server.\n+We will make use of this facility\n+to notify the device of account status changes.\n+\n+The WebPush specification allows messages to be sent\n+with or without a payload.\n+To keep things simple\n+we will use an empty message to indicate\n+that there has been a change\n+in the core account status information,\n+without communicating any more precise details\n+of what that change may have been.\n+This will give us an opportunity to gain experience\n+with using push notifications in production,\n+without having to commit to and build\n+all the details of a full notification/communication protocol.\n+\n+A future feature will define the semantics\n+of push notifications with a non-empty payload.\n+\n+When a connected device receives\n+a push notification on its registered endpoint,\n+and the notification has an empty payload,\n+the device should perform the following checks\n+to update its view of the account status:\n+\n+*  Check account status to see if it's verified, or deleted, or email has been changed\n+*  If that fails with a 401, its session token has been revoked somehow.\n+*  Check its device registration record for updated name\n+*  Check for new or removed peer devices in the devices list\n+*  Refresh profile information?\n+\n+\n+The fxa-auth-server will send an empty-payload message\n+to all registered devices\n+in response to the following actions:\n+\n+* User verifying their account\n+* User deleting their account\n+* A new device connection being recorded\n+* A device connection being deleted\n+* Any action that invalidates a sessionToken\n+* ...others?","path":"features/FxA-54-push-on-status-change/README.md","position":79,"original_position":79,"commit_id":"d63c0ff4a39dbe28f92877b44a463f432b81f40b","original_commit_id":"d63c0ff4a39dbe28f92877b44a463f432b81f40b","user":{"login":"philbooth","id":64367,"avatar_url":"https://avatars.githubusercontent.com/u/64367?v=3","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"When a device's lastAccessTime is updated?","created_at":"2015-12-16T12:34:13Z","updated_at":"2015-12-16T12:34:13Z","html_url":"https://github.com/mozilla/fxa/pull/87#discussion_r47770124","pull_request_url":"https://api.github.com/repos/mozilla/fxa/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/comments/47770124"},"html":{"href":"https://github.com/mozilla/fxa/pull/87#discussion_r47770124"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa/pulls/87","id":51492115,"html_url":"https://github.com/mozilla/fxa/pull/87","diff_url":"https://github.com/mozilla/fxa/pull/87.diff","patch_url":"https://github.com/mozilla/fxa/pull/87.patch","issue_url":"https://api.github.com/repos/mozilla/fxa/issues/87","number":87,"state":"open","locked":false,"title":"feat(fxa-54): First draft of push notifications for account status change","user":{"login":"rfk","id":34695,"avatar_url":"https://avatars.githubusercontent.com/u/34695?v=3","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},"body":"Here's a super-quick sketch of how we might start using push notifications to replace polling for account status updates.  @kitcambridge you've done a lot of thinking about this in prior work, could you please take a look over this and make sure I'm proposing something reasonable?","created_at":"2015-11-23T06:50:42Z","updated_at":"2015-12-16T12:34:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b82b03a87fdfe0ef653a92292fa73ad908c8287f","assignee":{"login":"rfk","id":34695,"avatar_url":"https://avatars.githubusercontent.com/u/34695?v=3","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mozilla/fxa/milestones/26","html_url":"https://github.com/mozilla/fxa/milestones/FxA-54:%20push%20on%20status%20change","labels_url":"https://api.github.com/repos/mozilla/fxa/milestones/26/labels","id":1424337,"number":26,"title":"FxA-54: push on status change","description":"https://mozilla.aha.io/features/FXA-54","creator":{"login":"rfk","id":34695,"avatar_url":"https://avatars.githubusercontent.com/u/34695?v=3","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-11-23T06:15:58Z","updated_at":"2015-11-23T06:52:12Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mozilla/fxa/pulls/87/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa/pulls/87/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa/issues/87/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/d63c0ff4a39dbe28f92877b44a463f432b81f40b","head":{"label":"mozilla:fxa-54-push-on-status-change","ref":"fxa-54-push-on-status-change","sha":"d63c0ff4a39dbe28f92877b44a463f432b81f40b","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":36831081,"name":"fxa","full_name":"mozilla/fxa","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa","description":"Top-level repository for Firefox Accounts","fork":false,"url":"https://api.github.com/repos/mozilla/fxa","forks_url":"https://api.github.com/repos/mozilla/fxa/forks","keys_url":"https://api.github.com/repos/mozilla/fxa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa/events","assignees_url":"https://api.github.com/repos/mozilla/fxa/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa/merges","archive_url":"https://api.github.com/repos/mozilla/fxa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa/releases{/id}","created_at":"2015-06-03T21:16:46Z","updated_at":"2015-10-24T16:37:07Z","pushed_at":"2015-12-14T15:22:47Z","git_url":"git://github.com/mozilla/fxa.git","ssh_url":"git@github.com:mozilla/fxa.git","clone_url":"https://github.com/mozilla/fxa.git","svn_url":"https://github.com/mozilla/fxa","homepage":"http://fxa.readthedocs.org","size":2674,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":4,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"3a0f338ad6c020a6d2dd31fd6cd13fab994d0344","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":36831081,"name":"fxa","full_name":"mozilla/fxa","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa","description":"Top-level repository for Firefox Accounts","fork":false,"url":"https://api.github.com/repos/mozilla/fxa","forks_url":"https://api.github.com/repos/mozilla/fxa/forks","keys_url":"https://api.github.com/repos/mozilla/fxa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa/events","assignees_url":"https://api.github.com/repos/mozilla/fxa/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa/merges","archive_url":"https://api.github.com/repos/mozilla/fxa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa/releases{/id}","created_at":"2015-06-03T21:16:46Z","updated_at":"2015-10-24T16:37:07Z","pushed_at":"2015-12-14T15:22:47Z","git_url":"git://github.com/mozilla/fxa.git","ssh_url":"git@github.com:mozilla/fxa.git","clone_url":"https://github.com/mozilla/fxa.git","svn_url":"https://github.com/mozilla/fxa","homepage":"http://fxa.readthedocs.org","size":2674,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/87"},"html":{"href":"https://github.com/mozilla/fxa/pull/87"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa/issues/87"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa/statuses/d63c0ff4a39dbe28f92877b44a463f432b81f40b"}}}}