{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/1299","repository_url":"https://api.github.com/repos/mozilla/fxa-auth-server","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/1299/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/1299/comments","events_url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/1299/events","html_url":"https://github.com/mozilla/fxa-auth-server/pull/1299","id":161492713,"number":1299,"title":"feat(server): synthesize device records for sync sessions","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},"labels":[{"url":"https://api.github.com/repos/mozilla/fxa-auth-server/labels/waffle:active","name":"waffle:active","color":"ededed"}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":6,"created_at":"2016-06-21T17:16:59Z","updated_at":"2016-06-30T00:52:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-auth-server/pulls/1299","html_url":"https://github.com/mozilla/fxa-auth-server/pull/1299","diff_url":"https://github.com/mozilla/fxa-auth-server/pull/1299.diff","patch_url":"https://github.com/mozilla/fxa-auth-server/pull/1299.patch"},"body":"Fixes #1196.\r\n\r\nThe approach taken should be exactly as proposed in the issue but, to be clear:\r\n\r\n* Placeholder device records are created for Sync sessions on `/account/signup`, `/account/login` and, if there's not already a device for the requesting session, on `/certificate/sign`.\r\n\r\n* Placeholder device records differ from normal device records in that they have no `name` or `type`. These are enforced by the payload schema on `/account/device`, so placeholder device records are not created by that endpoint.\r\n\r\n* In `/account/devices`, placeholder device records are returned with synthesized `name` and `type` fields based on the user agent data we have stored against the equivalent sessions. In the worst case scenario, if we don't have valid user agent data for any reason, `name` is set to `'Unidentified device'` and `type` is set to `'desktop'`.\r\n\r\n* When a legitimate device registration occurs, we check to see if a placeholder device exists for that session. If it does, we re-use the same device id and the placeholder magically becomes a real device.\r\n\r\nThe placeholder-to-real-device magic is covered by the remote tests and the synthesize-a-device-name magic is covered by the local tests. The creation of placeholder records is covered by both.\r\n\r\n@rfk, hopefully this is what you had in mind. r?"},"comment":{"url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/comments/229531493","html_url":"https://github.com/mozilla/fxa-auth-server/pull/1299#issuecomment-229531493","issue_url":"https://api.github.com/repos/mozilla/fxa-auth-server/issues/1299","id":229531493,"user":{"login":"seanmonstar","id":51479,"avatar_url":"https://avatars.githubusercontent.com/u/51479?v=3","gravatar_id":"","url":"https://api.github.com/users/seanmonstar","html_url":"https://github.com/seanmonstar","followers_url":"https://api.github.com/users/seanmonstar/followers","following_url":"https://api.github.com/users/seanmonstar/following{/other_user}","gists_url":"https://api.github.com/users/seanmonstar/gists{/gist_id}","starred_url":"https://api.github.com/users/seanmonstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanmonstar/subscriptions","organizations_url":"https://api.github.com/users/seanmonstar/orgs","repos_url":"https://api.github.com/users/seanmonstar/repos","events_url":"https://api.github.com/users/seanmonstar/events{/privacy}","received_events_url":"https://api.github.com/users/seanmonstar/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T00:52:32Z","updated_at":"2016-06-30T00:52:32Z","body":"`name = randomHashString(32)` :D"}}
{"actor":{"display_login":"seanmonstar"}}