{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/43370562","id":43370562,"diff_hunk":"@@ -168,12 +189,66 @@ var HistoryHelper = (() => {\n     });\n   }\n \n+  function checkIfCleared(userid) {\n+    return getLastRevisionId(userid).then(lastRevisionId => {\n+      return _ensureStore().then(store => {","path":"apps/sync/js/adapters/history.js","position":47,"original_position":47,"commit_id":"811d5c51eb48af2fff655eba9f7b65c7834775d0","original_commit_id":"811d5c51eb48af2fff655eba9f7b65c7834775d0","user":{"login":"ferjm","id":480202,"avatar_url":"https://avatars.githubusercontent.com/u/480202?v=3","gravatar_id":"","url":"https://api.github.com/users/ferjm","html_url":"https://github.com/ferjm","followers_url":"https://api.github.com/users/ferjm/followers","following_url":"https://api.github.com/users/ferjm/following{/other_user}","gists_url":"https://api.github.com/users/ferjm/gists{/gist_id}","starred_url":"https://api.github.com/users/ferjm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferjm/subscriptions","organizations_url":"https://api.github.com/users/ferjm/orgs","repos_url":"https://api.github.com/users/ferjm/repos","events_url":"https://api.github.com/users/ferjm/events{/privacy}","received_events_url":"https://api.github.com/users/ferjm/received_events","type":"User","site_admin":false},"body":"We are using `getLastRevisionId` only here and this method is also returning the last revision ID, so it may make sense to move all this code into `getLastRevisionId` and get rid of `checkIfCleared`.","created_at":"2015-10-29T10:44:08Z","updated_at":"2015-10-29T10:44:08Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/32619#discussion_r43370562","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/43370562"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32619#discussion_r43370562"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619","id":48288628,"html_url":"https://github.com/mozilla-b2g/gaia/pull/32619","diff_url":"https://github.com/mozilla-b2g/gaia/pull/32619.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/32619.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32619","number":32619,"state":"open","locked":false,"title":"Bug 1216319 - clear command, r=ferjm","user":{"login":"michielbdejong","id":408412,"avatar_url":"https://avatars.githubusercontent.com/u/408412?v=3","gravatar_id":"","url":"https://api.github.com/users/michielbdejong","html_url":"https://github.com/michielbdejong","followers_url":"https://api.github.com/users/michielbdejong/followers","following_url":"https://api.github.com/users/michielbdejong/following{/other_user}","gists_url":"https://api.github.com/users/michielbdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/michielbdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michielbdejong/subscriptions","organizations_url":"https://api.github.com/users/michielbdejong/orgs","repos_url":"https://api.github.com/users/michielbdejong/repos","events_url":"https://api.github.com/users/michielbdejong/events{/privacy}","received_events_url":"https://api.github.com/users/michielbdejong/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-21T05:04:34Z","updated_at":"2015-10-29T10:44:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bb7e213d84799f860ba03536dd6c611bc2f3c9a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32619/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/811d5c51eb48af2fff655eba9f7b65c7834775d0","head":{"label":"michielbdejong:1216319-clear-command","ref":"1216319-clear-command","sha":"811d5c51eb48af2fff655eba9f7b65c7834775d0","user":{"login":"michielbdejong","id":408412,"avatar_url":"https://avatars.githubusercontent.com/u/408412?v=3","gravatar_id":"","url":"https://api.github.com/users/michielbdejong","html_url":"https://github.com/michielbdejong","followers_url":"https://api.github.com/users/michielbdejong/followers","following_url":"https://api.github.com/users/michielbdejong/following{/other_user}","gists_url":"https://api.github.com/users/michielbdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/michielbdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michielbdejong/subscriptions","organizations_url":"https://api.github.com/users/michielbdejong/orgs","repos_url":"https://api.github.com/users/michielbdejong/repos","events_url":"https://api.github.com/users/michielbdejong/events{/privacy}","received_events_url":"https://api.github.com/users/michielbdejong/received_events","type":"User","site_admin":false},"repo":{"id":32516991,"name":"gaia","full_name":"michielbdejong/gaia","owner":{"login":"michielbdejong","id":408412,"avatar_url":"https://avatars.githubusercontent.com/u/408412?v=3","gravatar_id":"","url":"https://api.github.com/users/michielbdejong","html_url":"https://github.com/michielbdejong","followers_url":"https://api.github.com/users/michielbdejong/followers","following_url":"https://api.github.com/users/michielbdejong/following{/other_user}","gists_url":"https://api.github.com/users/michielbdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/michielbdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michielbdejong/subscriptions","organizations_url":"https://api.github.com/users/michielbdejong/orgs","repos_url":"https://api.github.com/users/michielbdejong/repos","events_url":"https://api.github.com/users/michielbdejong/events{/privacy}","received_events_url":"https://api.github.com/users/michielbdejong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michielbdejong/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":true,"url":"https://api.github.com/repos/michielbdejong/gaia","forks_url":"https://api.github.com/repos/michielbdejong/gaia/forks","keys_url":"https://api.github.com/repos/michielbdejong/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michielbdejong/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michielbdejong/gaia/teams","hooks_url":"https://api.github.com/repos/michielbdejong/gaia/hooks","issue_events_url":"https://api.github.com/repos/michielbdejong/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/michielbdejong/gaia/events","assignees_url":"https://api.github.com/repos/michielbdejong/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/michielbdejong/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/michielbdejong/gaia/tags","blobs_url":"https://api.github.com/repos/michielbdejong/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michielbdejong/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michielbdejong/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/michielbdejong/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michielbdejong/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/michielbdejong/gaia/languages","stargazers_url":"https://api.github.com/repos/michielbdejong/gaia/stargazers","contributors_url":"https://api.github.com/repos/michielbdejong/gaia/contributors","subscribers_url":"https://api.github.com/repos/michielbdejong/gaia/subscribers","subscription_url":"https://api.github.com/repos/michielbdejong/gaia/subscription","commits_url":"https://api.github.com/repos/michielbdejong/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/michielbdejong/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/michielbdejong/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/michielbdejong/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/michielbdejong/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/michielbdejong/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michielbdejong/gaia/merges","archive_url":"https://api.github.com/repos/michielbdejong/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michielbdejong/gaia/downloads","issues_url":"https://api.github.com/repos/michielbdejong/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/michielbdejong/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/michielbdejong/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/michielbdejong/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michielbdejong/gaia/labels{/name}","releases_url":"https://api.github.com/repos/michielbdejong/gaia/releases{/id}","created_at":"2015-03-19T11:15:53Z","updated_at":"2015-03-19T11:16:20Z","pushed_at":"2015-10-29T09:50:30Z","git_url":"git://github.com/michielbdejong/gaia.git","ssh_url":"git@github.com:michielbdejong/gaia.git","clone_url":"https://github.com/michielbdejong/gaia.git","svn_url":"https://github.com/michielbdejong/gaia","homepage":"https://wiki.mozilla.org/B2G","size":973813,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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-b2g:master","ref":"master","sha":"1aaf2c1b3ef193eaff65292dc8a6b825bb03b987","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-10-26T01:49:34Z","pushed_at":"2015-10-29T10:40:03Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1679150,"stargazers_count":1992,"watchers_count":1992,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2499,"mirror_url":null,"open_issues_count":1259,"forks":2499,"open_issues":1259,"watchers":1992,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32619"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32619"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32619/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32619/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/811d5c51eb48af2fff655eba9f7b65c7834775d0"}}}}