{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/158150143","pull_request_review_id":84914281,"id":158150143,"diff_hunk":"@@ -0,0 +1,54 @@\n+package storage\n+\n+import (\n+\t\"encoding/hex\"\n+\n+\t\"github.com/keybase/client/go/gregor\"\n+\t\"github.com/keybase/client/go/libkb\"\n+)\n+\n+type localDismissalsRecord struct {\n+\tDismissals [][]byte `json:\"d\"`\n+}\n+\n+type LocalDb struct {\n+\tlibkb.Contextified\n+}\n+\n+func NewLocalDB(g *libkb.GlobalContext) *LocalDb {\n+\treturn &LocalDb{\n+\t\tContextified: libkb.NewContextified(g),\n+\t}\n+}\n+\n+func dbKey(u gregor.UID) libkb.DbKey {\n+\treturn libkb.DbKey{Typ: libkb.DBGregor, Key: hex.EncodeToString(u.Bytes())}\n+}\n+\n+func dbKeyLocalDismiss(u gregor.UID) libkb.DbKey {\n+\treturn libkb.DbKey{Typ: libkb.DBGregor, Key: \"_ld\" + hex.EncodeToString(u.Bytes())}\n+}\n+\n+func (db *LocalDb) Store(u gregor.UID, state []byte, localDismissals [][]byte) error {","path":"go/gregor/storage/db.go","position":32,"original_position":32,"commit_id":"f59eee019e8d1216f4ebc5ff1b54a32fcc19e55f","original_commit_id":"f59eee019e8d1216f4ebc5ff1b54a32fcc19e55f","user":{"login":"mmaxim","id":1250314,"avatar_url":"https://avatars1.githubusercontent.com/u/1250314?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaxim","html_url":"https://github.com/mmaxim","followers_url":"https://api.github.com/users/mmaxim/followers","following_url":"https://api.github.com/users/mmaxim/following{/other_user}","gists_url":"https://api.github.com/users/mmaxim/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaxim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaxim/subscriptions","organizations_url":"https://api.github.com/users/mmaxim/orgs","repos_url":"https://api.github.com/users/mmaxim/repos","events_url":"https://api.github.com/users/mmaxim/events{/privacy}","received_events_url":"https://api.github.com/users/mmaxim/received_events","type":"User","site_admin":false},"body":"Not really, there is really no loss in having to blow it away. ","created_at":"2017-12-20T22:13:25Z","updated_at":"2017-12-20T22:13:25Z","html_url":"https://github.com/keybase/client/pull/9977#discussion_r158150143","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/9977","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/158150143"},"html":{"href":"https://github.com/keybase/client/pull/9977#discussion_r158150143"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/9977"}},"in_reply_to_id":158145158},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/9977","id":159237940,"html_url":"https://github.com/keybase/client/pull/9977","diff_url":"https://github.com/keybase/client/pull/9977.diff","patch_url":"https://github.com/keybase/client/pull/9977.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/9977","number":9977,"state":"open","locked":false,"title":"add local dismissal feature for gregor message playback CORE-6810","user":{"login":"mmaxim","id":1250314,"avatar_url":"https://avatars1.githubusercontent.com/u/1250314?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaxim","html_url":"https://github.com/mmaxim","followers_url":"https://api.github.com/users/mmaxim/followers","following_url":"https://api.github.com/users/mmaxim/following{/other_user}","gists_url":"https://api.github.com/users/mmaxim/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaxim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaxim/subscriptions","organizations_url":"https://api.github.com/users/mmaxim/orgs","repos_url":"https://api.github.com/users/mmaxim/repos","events_url":"https://api.github.com/users/mmaxim/events{/privacy}","received_events_url":"https://api.github.com/users/mmaxim/received_events","type":"User","site_admin":false},"body":"Patch does the following:\r\n\r\n1.) Add the ability to create \"local dismissals\" for items from the Gregor state on a device. These local dismissals serve to prevent replaying a Gregor item more than once. Any handler can selectively locally dismiss depending on the message. The item will still be in the state, but just not considered for replay. The advantage is we can continue to transmit the device independent Gregor messages with short expirations, but also not have to continually process them on devices that have already done so.\r\n2.) Change `team.changed` to locally dismiss any items after successfully processing them.","created_at":"2017-12-19T18:21:19Z","updated_at":"2017-12-20T22:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b725b41eb526e07f637f15fa6130cce9b912369","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/9977/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/9977/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/9977/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/f59eee019e8d1216f4ebc5ff1b54a32fcc19e55f","head":{"label":"keybase:mike/CORE-6810","ref":"mike/CORE-6810","sha":"f59eee019e8d1216f4ebc5ff1b54a32fcc19e55f","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2017-12-20T19:09:32Z","pushed_at":"2017-12-20T22:04:17Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":215086,"stargazers_count":3001,"watchers_count":3001,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":1702,"license":{"key":"bsd-3-clause","name":"BSD 3-clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":270,"open_issues":1702,"watchers":3001,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"a95d8496034286d5796b1ff1d4210f98915638b0","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2017-12-20T19:09:32Z","pushed_at":"2017-12-20T22:04:17Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":215086,"stargazers_count":3001,"watchers_count":3001,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":1702,"license":{"key":"bsd-3-clause","name":"BSD 3-clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":270,"open_issues":1702,"watchers":3001,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/9977"},"html":{"href":"https://github.com/keybase/client/pull/9977"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/9977"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/9977/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/9977/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/9977/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/f59eee019e8d1216f4ebc5ff1b54a32fcc19e55f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mmaxim"}}