{"action":"created","comment":{"url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments/190046920","pull_request_review_id":122345089,"id":190046920,"diff_hunk":"@@ -582,18 +588,19 @@ export class DbTargetChange {\n     /**\n      * The snapshot version for this change.\n      */\n-    public snapshotVersion: DbTimestamp,\n+    public snapshotVersion: DbTimestampArray,\n     /**\n      * The keys of the changed documents in this snapshot.\n      */\n-    public changes: {\n-      added?: EncodedResourcePath[];\n-      modified?: EncodedResourcePath[];\n-      removed?: EncodedResourcePath[];\n-    }\n+    public changes: EncodedResourcePath[]","path":"packages/firestore/src/local/indexeddb_schema.ts","position":66,"original_position":27,"commit_id":"2505f6f2b26ddbb07a20b7d8c338d21c069c97e9","original_commit_id":"443e981a2e188afb66fb195fd1e27ee073283ed6","user":{"login":"schmidt-sebastian","id":19397744,"avatar_url":"https://avatars3.githubusercontent.com/u/19397744?v=4","gravatar_id":"","url":"https://api.github.com/users/schmidt-sebastian","html_url":"https://github.com/schmidt-sebastian","followers_url":"https://api.github.com/users/schmidt-sebastian/followers","following_url":"https://api.github.com/users/schmidt-sebastian/following{/other_user}","gists_url":"https://api.github.com/users/schmidt-sebastian/gists{/gist_id}","starred_url":"https://api.github.com/users/schmidt-sebastian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmidt-sebastian/subscriptions","organizations_url":"https://api.github.com/users/schmidt-sebastian/orgs","repos_url":"https://api.github.com/users/schmidt-sebastian/repos","events_url":"https://api.github.com/users/schmidt-sebastian/events{/privacy}","received_events_url":"https://api.github.com/users/schmidt-sebastian/received_events","type":"User","site_admin":false},"body":"As we discussed last week, I have reworked this to use a document change log instead. My main argument against this was churn, and the main argument for this was that this will definitely solve the limbo document problem without any further work. Let me know what you think of the updated PR.\r\n\r\nOne nice outcome of this is that I no longer have to build up and buffer changes, since the RemoteDocumentBuffer already exists for this purpose.","created_at":"2018-05-22T20:45:16Z","updated_at":"2018-05-22T20:48:02Z","html_url":"https://github.com/firebase/firebase-js-sdk/pull/782#discussion_r190046920","pull_request_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments/190046920"},"html":{"href":"https://github.com/firebase/firebase-js-sdk/pull/782#discussion_r190046920"},"pull_request":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782"}},"in_reply_to_id":188763760},"pull_request":{"url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782","id":186417786,"html_url":"https://github.com/firebase/firebase-js-sdk/pull/782","diff_url":"https://github.com/firebase/firebase-js-sdk/pull/782.diff","patch_url":"https://github.com/firebase/firebase-js-sdk/pull/782.patch","issue_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/782","number":782,"state":"open","locked":false,"title":"Storing a Query Changelog","user":{"login":"schmidt-sebastian","id":19397744,"avatar_url":"https://avatars3.githubusercontent.com/u/19397744?v=4","gravatar_id":"","url":"https://api.github.com/users/schmidt-sebastian","html_url":"https://github.com/schmidt-sebastian","followers_url":"https://api.github.com/users/schmidt-sebastian/followers","following_url":"https://api.github.com/users/schmidt-sebastian/following{/other_user}","gists_url":"https://api.github.com/users/schmidt-sebastian/gists{/gist_id}","starred_url":"https://api.github.com/users/schmidt-sebastian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmidt-sebastian/subscriptions","organizations_url":"https://api.github.com/users/schmidt-sebastian/orgs","repos_url":"https://api.github.com/users/schmidt-sebastian/repos","events_url":"https://api.github.com/users/schmidt-sebastian/events{/privacy}","received_events_url":"https://api.github.com/users/schmidt-sebastian/received_events","type":"User","site_admin":false},"body":"This might be more of an RFC before https://github.com/firebase/firebase-js-sdk/pull/784 gets merged, but here we go either way.\r\n\r\nThis PR:\r\n- Combines the add/remove Query Cache callbacks in the persistence layer into one function (applyTargetState).  This function then deals with the query changelog as well.\r\n- Adds functionality to the query cache to retrieve the query changes since a specific snapshot version.\r\n- Changes the targetChange object store to only store a list of changed document keys (as discussed, it doesn't matter whether a document was added, modified or removed as the view computation just uses a list of modified keys).\r\n- Adds a DbTimestampArray type since DbTimestamps can't be used in keys.\r\n\r\n~~Also some general cleanup~~ \r\n~~Removes a bunch of error logs from running with Mock persistence by not logging the errors from accessing window.localStorage.get()~~\r\n\r\n","created_at":"2018-05-07T17:50:58Z","updated_at":"2018-05-22T20:48:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd85e23fdc3238cd9aa82bdf63c06bbc4cea6fad","assignee":{"login":"schmidt-sebastian","id":19397744,"avatar_url":"https://avatars3.githubusercontent.com/u/19397744?v=4","gravatar_id":"","url":"https://api.github.com/users/schmidt-sebastian","html_url":"https://github.com/schmidt-sebastian","followers_url":"https://api.github.com/users/schmidt-sebastian/followers","following_url":"https://api.github.com/users/schmidt-sebastian/following{/other_user}","gists_url":"https://api.github.com/users/schmidt-sebastian/gists{/gist_id}","starred_url":"https://api.github.com/users/schmidt-sebastian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmidt-sebastian/subscriptions","organizations_url":"https://api.github.com/users/schmidt-sebastian/orgs","repos_url":"https://api.github.com/users/schmidt-sebastian/repos","events_url":"https://api.github.com/users/schmidt-sebastian/events{/privacy}","received_events_url":"https://api.github.com/users/schmidt-sebastian/received_events","type":"User","site_admin":false},"assignees":[{"login":"schmidt-sebastian","id":19397744,"avatar_url":"https://avatars3.githubusercontent.com/u/19397744?v=4","gravatar_id":"","url":"https://api.github.com/users/schmidt-sebastian","html_url":"https://github.com/schmidt-sebastian","followers_url":"https://api.github.com/users/schmidt-sebastian/followers","following_url":"https://api.github.com/users/schmidt-sebastian/following{/other_user}","gists_url":"https://api.github.com/users/schmidt-sebastian/gists{/gist_id}","starred_url":"https://api.github.com/users/schmidt-sebastian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmidt-sebastian/subscriptions","organizations_url":"https://api.github.com/users/schmidt-sebastian/orgs","repos_url":"https://api.github.com/users/schmidt-sebastian/repos","events_url":"https://api.github.com/users/schmidt-sebastian/events{/privacy}","received_events_url":"https://api.github.com/users/schmidt-sebastian/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"wilhuff","id":10249104,"avatar_url":"https://avatars1.githubusercontent.com/u/10249104?v=4","gravatar_id":"","url":"https://api.github.com/users/wilhuff","html_url":"https://github.com/wilhuff","followers_url":"https://api.github.com/users/wilhuff/followers","following_url":"https://api.github.com/users/wilhuff/following{/other_user}","gists_url":"https://api.github.com/users/wilhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/wilhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilhuff/subscriptions","organizations_url":"https://api.github.com/users/wilhuff/orgs","repos_url":"https://api.github.com/users/wilhuff/repos","events_url":"https://api.github.com/users/wilhuff/events{/privacy}","received_events_url":"https://api.github.com/users/wilhuff/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":606540090,"url":"https://api.github.com/repos/firebase/firebase-js-sdk/labels/needs-triage","name":"needs-triage","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782/commits","review_comments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782/comments","review_comment_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/782/comments","statuses_url":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/2505f6f2b26ddbb07a20b7d8c338d21c069c97e9","head":{"label":"firebase:multitab-changelog","ref":"multitab-changelog","sha":"2505f6f2b26ddbb07a20b7d8c338d21c069c97e9","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":89290483,"name":"firebase-js-sdk","full_name":"firebase/firebase-js-sdk","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/firebase-js-sdk","description":"Firebase Javascript SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-js-sdk","forks_url":"https://api.github.com/repos/firebase/firebase-js-sdk/forks","keys_url":"https://api.github.com/repos/firebase/firebase-js-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-js-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-js-sdk/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-js-sdk/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-js-sdk/events","assignees_url":"https://api.github.com/repos/firebase/firebase-js-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-js-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-js-sdk/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-js-sdk/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-js-sdk/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-js-sdk/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-js-sdk/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-js-sdk/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-js-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-js-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-js-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-js-sdk/merges","archive_url":"https://api.github.com/repos/firebase/firebase-js-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-js-sdk/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-js-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-js-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-js-sdk/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-js-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/deployments","created_at":"2017-04-24T21:52:11Z","updated_at":"2018-05-22T20:26:35Z","pushed_at":"2018-05-22T20:46:30Z","git_url":"git://github.com/firebase/firebase-js-sdk.git","ssh_url":"git@github.com:firebase/firebase-js-sdk.git","clone_url":"https://github.com/firebase/firebase-js-sdk.git","svn_url":"https://github.com/firebase/firebase-js-sdk","homepage":"https://firebase.google.com/docs/web/setup","size":15185,"stargazers_count":1115,"watchers_count":1115,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":134,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":161,"open_issues":134,"watchers":1115,"default_branch":"master"}},"base":{"label":"firebase:firestore-multi-tab-with-unreviewd-eventaggregator","ref":"firestore-multi-tab-with-unreviewd-eventaggregator","sha":"5de94fe98f75683c087fe8cd40200460c96086d4","user":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"repo":{"id":89290483,"name":"firebase-js-sdk","full_name":"firebase/firebase-js-sdk","owner":{"login":"firebase","id":1335026,"avatar_url":"https://avatars2.githubusercontent.com/u/1335026?v=4","gravatar_id":"","url":"https://api.github.com/users/firebase","html_url":"https://github.com/firebase","followers_url":"https://api.github.com/users/firebase/followers","following_url":"https://api.github.com/users/firebase/following{/other_user}","gists_url":"https://api.github.com/users/firebase/gists{/gist_id}","starred_url":"https://api.github.com/users/firebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firebase/subscriptions","organizations_url":"https://api.github.com/users/firebase/orgs","repos_url":"https://api.github.com/users/firebase/repos","events_url":"https://api.github.com/users/firebase/events{/privacy}","received_events_url":"https://api.github.com/users/firebase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firebase/firebase-js-sdk","description":"Firebase Javascript SDK","fork":false,"url":"https://api.github.com/repos/firebase/firebase-js-sdk","forks_url":"https://api.github.com/repos/firebase/firebase-js-sdk/forks","keys_url":"https://api.github.com/repos/firebase/firebase-js-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firebase/firebase-js-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firebase/firebase-js-sdk/teams","hooks_url":"https://api.github.com/repos/firebase/firebase-js-sdk/hooks","issue_events_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/firebase/firebase-js-sdk/events","assignees_url":"https://api.github.com/repos/firebase/firebase-js-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/firebase/firebase-js-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/firebase/firebase-js-sdk/tags","blobs_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/firebase/firebase-js-sdk/languages","stargazers_url":"https://api.github.com/repos/firebase/firebase-js-sdk/stargazers","contributors_url":"https://api.github.com/repos/firebase/firebase-js-sdk/contributors","subscribers_url":"https://api.github.com/repos/firebase/firebase-js-sdk/subscribers","subscription_url":"https://api.github.com/repos/firebase/firebase-js-sdk/subscription","commits_url":"https://api.github.com/repos/firebase/firebase-js-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/firebase/firebase-js-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/firebase/firebase-js-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/firebase/firebase-js-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firebase/firebase-js-sdk/merges","archive_url":"https://api.github.com/repos/firebase/firebase-js-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firebase/firebase-js-sdk/downloads","issues_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/firebase/firebase-js-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/firebase/firebase-js-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firebase/firebase-js-sdk/labels{/name}","releases_url":"https://api.github.com/repos/firebase/firebase-js-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/deployments","created_at":"2017-04-24T21:52:11Z","updated_at":"2018-05-22T20:26:35Z","pushed_at":"2018-05-22T20:46:30Z","git_url":"git://github.com/firebase/firebase-js-sdk.git","ssh_url":"git@github.com:firebase/firebase-js-sdk.git","clone_url":"https://github.com/firebase/firebase-js-sdk.git","svn_url":"https://github.com/firebase/firebase-js-sdk","homepage":"https://firebase.google.com/docs/web/setup","size":15185,"stargazers_count":1115,"watchers_count":1115,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":134,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":161,"open_issues":134,"watchers":1115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782"},"html":{"href":"https://github.com/firebase/firebase-js-sdk/pull/782"},"issue":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/782"},"comments":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/782/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782/comments"},"review_comment":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/782/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/2505f6f2b26ddbb07a20b7d8c338d21c069c97e9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"schmidt-sebastian"}}