{"action":"created","issue":{"url":"https://api.github.com/repos/keybase/client/issues/5368","repository_url":"https://api.github.com/repos/keybase/client","labels_url":"https://api.github.com/repos/keybase/client/issues/5368/labels{/name}","comments_url":"https://api.github.com/repos/keybase/client/issues/5368/comments","events_url":"https://api.github.com/repos/keybase/client/issues/5368/events","html_url":"https://github.com/keybase/client/pull/5368","id":200457465,"number":5368,"title":"cache results of GetInboxRemote CORE-4186","user":{"login":"mmaxim","id":1250314,"avatar_url":"https://avatars.githubusercontent.com/u/1250314?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-12T19:27:26Z","updated_at":"2017-01-13T04:52:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/5368","html_url":"https://github.com/keybase/client/pull/5368","diff_url":"https://github.com/keybase/client/pull/5368.diff","patch_url":"https://github.com/keybase/client/pull/5368.patch"},"body":"So this patch is very large because I refactored inboxsource.go a bunch (which spilled over into chat_local.go and gregor.go). I've outlined my strategy below:\r\n\r\n1.) We store the server result from `GetInboxRemote` on the disk. Unboxing of `MaxMessages` uses the bodies cache, so we don't need to store them twice.\r\n2.) In order to know we can serve a given query+pagination request for reading the inbox, we track which queries we've seen before. IFF we have seen the query+pagination before, we will serve results from the cache.\r\n3.) inbox.go implements running query conditions and performing pagination in a way identical to the server. It also handles finalize mechanics properly.\r\n4.) Add way more logging, and label it better so chat activity is more easily pulled out of the logs with grep.\r\n5.) Add the `Syncer` type, which now runs the show on alerting the frontend about changes in the validity of both the inbox and bodies cache. This will be triggered either from traditional reasons (disconnect, bad Gregor new message), but as well if the inbox version mismatches the stored copy. On reconnect, we load the inbox version and compare to the disk.\r\n6.) Trigger `Syncer` notifications if we detect an inbox version mismatch on any Gregor message from `HybridInboxSource`.\r\n7.) Put `InboxSource` on the global context, so it can be easily found and configured from the environment.\r\n8.) Add a bunch of tests for inbox.go, and use `HybridInboxSource` in all the rest of the `chat`and `service` package tests.\r\n\r\nAnyway, apologies for the length of this, but I wasn't sure how else to get this up here."},"comment":{"url":"https://api.github.com/repos/keybase/client/issues/comments/272360817","html_url":"https://github.com/keybase/client/pull/5368#issuecomment-272360817","issue_url":"https://api.github.com/repos/keybase/client/issues/5368","id":272360817,"user":{"login":"mmaxim","id":1250314,"avatar_url":"https://avatars.githubusercontent.com/u/1250314?v=3","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},"created_at":"2017-01-13T04:52:11Z","updated_at":"2017-01-13T04:52:11Z","body":"@maxtaco did you want to take a look? If not I am going to merge tomorrow afternoon when I get in, I'd for this to be in use for awhile before we do the alpha release."}}
{"actor":{"display_login":"mmaxim"}}