{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/comments/93256181","pull_request_review_id":13779075,"id":93256181,"diff_hunk":"@@ -265,36 +265,42 @@ MemoryStore.prototype = {\n     for (var i = 0; i < ids.length; i++) {\n       var id = ids[i];\n       if (this.tokens[id].userId.toString('hex') === uid) {\n-        activeClientIds.push(this.tokens[id].clientId);\n+        activeClientIds.push({clientid: this.tokens[id].clientId, clientTokenTime: this.tokens[id].createdAt});\n       }\n     }\n \n     // unique clients\n-    activeClientIds.forEach(function (clientIdBuf) {\n-      var clientIdHex = unbuf(clientIdBuf);\n-      if (! findByBufProp(activeClients, 'id', clientIdHex)) {\n-        var c = self.clients[clientIdHex];\n+    activeClientIds.forEach(function (clientBuf) {\n+      var clientIdHex = unbuf(clientBuf.clientid);\n+      var clientTokenTime = unbuf(clientBuf.clientTokenTime);\n+      var index = findByBufProp(activeClients, 'id', clientIdHex);\n+      var c = self.clients[clientIdHex];\n+      if (! Number.isInteger(index)) {","path":"lib/db/memory.js","position":31,"original_position":31,"commit_id":"222299c8a2025b3bd2e702a7d124743945c7789c","original_commit_id":"222299c8a2025b3bd2e702a7d124743945c7789c","user":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"body":"I think we need to rethink this part a bit:\r\n\r\n```js\r\n+      var index = findByBufProp(activeClients, 'id', clientIdHex);\r\n+      var c = self.clients[clientIdHex];\r\n+      if (! Number.isInteger(index)) {\r\n```\r\n\r\nWe should probably not use `client.id.name` below. It gives an impression that `id`s have 'names`.","created_at":"2016-12-20T15:13:07Z","updated_at":"2016-12-20T15:13:07Z","html_url":"https://github.com/mozilla/fxa-oauth-server/pull/436#discussion_r93256181","pull_request_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/comments/93256181"},"html":{"href":"https://github.com/mozilla/fxa-oauth-server/pull/436#discussion_r93256181"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436","id":98642038,"html_url":"https://github.com/mozilla/fxa-oauth-server/pull/436","diff_url":"https://github.com/mozilla/fxa-oauth-server/pull/436.diff","patch_url":"https://github.com/mozilla/fxa-oauth-server/pull/436.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/436","number":436,"state":"open","locked":false,"title":"[WIP] : fix(memorydb): token createdAt used instead of client createdAt","user":{"login":"divyabiyani","id":8852007,"avatar_url":"https://avatars.githubusercontent.com/u/8852007?v=3","gravatar_id":"","url":"https://api.github.com/users/divyabiyani","html_url":"https://github.com/divyabiyani","followers_url":"https://api.github.com/users/divyabiyani/followers","following_url":"https://api.github.com/users/divyabiyani/following{/other_user}","gists_url":"https://api.github.com/users/divyabiyani/gists{/gist_id}","starred_url":"https://api.github.com/users/divyabiyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyabiyani/subscriptions","organizations_url":"https://api.github.com/users/divyabiyani/orgs","repos_url":"https://api.github.com/users/divyabiyani/repos","events_url":"https://api.github.com/users/divyabiyani/events{/privacy}","received_events_url":"https://api.github.com/users/divyabiyani/received_events","type":"User","site_admin":false},"body":"Fix for #421.","created_at":"2016-12-19T21:22:23Z","updated_at":"2016-12-20T15:13:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7d924e1ea19e3d0697886ebd8761d6d09c13a4a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/436/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/statuses/222299c8a2025b3bd2e702a7d124743945c7789c","head":{"label":"divyabiyani:issue421","ref":"issue421","sha":"222299c8a2025b3bd2e702a7d124743945c7789c","user":{"login":"divyabiyani","id":8852007,"avatar_url":"https://avatars.githubusercontent.com/u/8852007?v=3","gravatar_id":"","url":"https://api.github.com/users/divyabiyani","html_url":"https://github.com/divyabiyani","followers_url":"https://api.github.com/users/divyabiyani/followers","following_url":"https://api.github.com/users/divyabiyani/following{/other_user}","gists_url":"https://api.github.com/users/divyabiyani/gists{/gist_id}","starred_url":"https://api.github.com/users/divyabiyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyabiyani/subscriptions","organizations_url":"https://api.github.com/users/divyabiyani/orgs","repos_url":"https://api.github.com/users/divyabiyani/repos","events_url":"https://api.github.com/users/divyabiyani/events{/privacy}","received_events_url":"https://api.github.com/users/divyabiyani/received_events","type":"User","site_admin":false},"repo":{"id":76575770,"name":"fxa-oauth-server","full_name":"divyabiyani/fxa-oauth-server","owner":{"login":"divyabiyani","id":8852007,"avatar_url":"https://avatars.githubusercontent.com/u/8852007?v=3","gravatar_id":"","url":"https://api.github.com/users/divyabiyani","html_url":"https://github.com/divyabiyani","followers_url":"https://api.github.com/users/divyabiyani/followers","following_url":"https://api.github.com/users/divyabiyani/following{/other_user}","gists_url":"https://api.github.com/users/divyabiyani/gists{/gist_id}","starred_url":"https://api.github.com/users/divyabiyani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divyabiyani/subscriptions","organizations_url":"https://api.github.com/users/divyabiyani/orgs","repos_url":"https://api.github.com/users/divyabiyani/repos","events_url":"https://api.github.com/users/divyabiyani/events{/privacy}","received_events_url":"https://api.github.com/users/divyabiyani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/divyabiyani/fxa-oauth-server","description":"OAuth server for Firefox Accounts","fork":true,"url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server","forks_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/forks","keys_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/teams","hooks_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/hooks","issue_events_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/issues/events{/number}","events_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/events","assignees_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/assignees{/user}","branches_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/branches{/branch}","tags_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/tags","blobs_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/statuses/{sha}","languages_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/languages","stargazers_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/stargazers","contributors_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/contributors","subscribers_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/subscribers","subscription_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/subscription","commits_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/contents/{+path}","compare_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/merges","archive_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/downloads","issues_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/issues{/number}","pulls_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/pulls{/number}","milestones_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/milestones{/number}","notifications_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/labels{/name}","releases_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/releases{/id}","deployments_url":"https://api.github.com/repos/divyabiyani/fxa-oauth-server/deployments","created_at":"2016-12-15T16:19:25Z","updated_at":"2016-12-15T16:19:27Z","pushed_at":"2016-12-20T13:09:51Z","git_url":"git://github.com/divyabiyani/fxa-oauth-server.git","ssh_url":"git@github.com:divyabiyani/fxa-oauth-server.git","clone_url":"https://github.com/divyabiyani/fxa-oauth-server.git","svn_url":"https://github.com/divyabiyani/fxa-oauth-server","homepage":"","size":1232,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"8b8369a3df99bfa9846283485c5a343269a3c0c7","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":16819795,"name":"fxa-oauth-server","full_name":"mozilla/fxa-oauth-server","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-oauth-server","description":"OAuth server for Firefox Accounts","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-oauth-server","forks_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-oauth-server/deployments","created_at":"2014-02-13T22:41:50Z","updated_at":"2016-11-18T11:37:56Z","pushed_at":"2016-12-20T13:09:52Z","git_url":"git://github.com/mozilla/fxa-oauth-server.git","ssh_url":"git@github.com:mozilla/fxa-oauth-server.git","clone_url":"https://github.com/mozilla/fxa-oauth-server.git","svn_url":"https://github.com/mozilla/fxa-oauth-server","homepage":"","size":1235,"stargazers_count":30,"watchers_count":30,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":17,"forks":29,"open_issues":17,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436"},"html":{"href":"https://github.com/mozilla/fxa-oauth-server/pull/436"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/436"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/issues/436/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/pulls/436/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-oauth-server/statuses/222299c8a2025b3bd2e702a7d124743945c7789c"}}}}
{"actor":{"display_login":"vladikoff"}}