{"action":"created","comment":{"url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments/205211259","pull_request_review_id":140125966,"id":205211259,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTIxMTI1OQ==","diff_hunk":"@@ -787,10 +787,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {\n     err: FirestoreError\n   ): Promise<void> {\n     if (isPrimaryLeaseLostError(err)) {\n-      log.debug(\n-        LOG_TAG,\n-        'Unexpectedly lost primary lease, attempting to recover'\n-      );\n+      log.debug(LOG_TAG, 'Unexpectedly lost primary lease');","path":"packages/firestore/src/core/sync_engine.ts","position":null,"original_position":47,"commit_id":"794e9f744d9cef341ece36930b32957e9c09320b","original_commit_id":"72aa4a9714fba8bc67ee9f81abaa502ec6c58103","user":{"login":"schmidt-sebastian","id":19397744,"node_id":"MDQ6VXNlcjE5Mzk3NzQ0","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":"Update the method and comment. Method is now `ignoreIfPrimaryLeaseLoss`.","created_at":"2018-07-25T18:12:26Z","updated_at":"2018-07-25T19:04:53Z","html_url":"https://github.com/firebase/firebase-js-sdk/pull/984#discussion_r205211259","pull_request_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/comments/205211259"},"html":{"href":"https://github.com/firebase/firebase-js-sdk/pull/984#discussion_r205211259"},"pull_request":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984"}},"in_reply_to_id":204926144},"pull_request":{"url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984","id":199673003,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjczMDAz","html_url":"https://github.com/firebase/firebase-js-sdk/pull/984","diff_url":"https://github.com/firebase/firebase-js-sdk/pull/984.diff","patch_url":"https://github.com/firebase/firebase-js-sdk/pull/984.patch","issue_url":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/984","number":984,"state":"open","locked":false,"title":"[Multi-Tab] Recover from unexpected primary lease loss","user":{"login":"schmidt-sebastian","id":19397744,"node_id":"MDQ6VXNlcjE5Mzk3NzQ0","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 PR examines all the places where we need a Primary lease in IndexedDb and adds recovery logic. The recovery logic is pretty simple - it just flips the client state to secondary.\r\n\r\nI tried to plumb through some checks on whether the client is actually no longer primary, but decided this is not worth it:\r\n- Neither Sync Engine nor Remote Store have access to the persistence layer. I would have needed to plumb the primary state through to LocalStore.\r\n- If the client should be primary, IndexedDb will reset the state in the next lease refresh.","created_at":"2018-07-06T08:01:57Z","updated_at":"2018-07-25T19:04:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e17ceb3000f1be1fcdc329b7acd60695df8b206e","assignee":{"login":"schmidt-sebastian","id":19397744,"node_id":"MDQ6VXNlcjE5Mzk3NzQ0","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,"node_id":"MDQ6VXNlcjE5Mzk3NzQ0","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,"node_id":"MDQ6VXNlcjEwMjQ5MTA0","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,"node_id":"MDU6TGFiZWw2MDY1NDAwOTA=","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/984/commits","review_comments_url":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984/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/984/comments","statuses_url":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/794e9f744d9cef341ece36930b32957e9c09320b","head":{"label":"firebase:multitab-recovery","ref":"multitab-recovery","sha":"794e9f744d9cef341ece36930b32957e9c09320b","user":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","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,"node_id":"MDEwOlJlcG9zaXRvcnk4OTI5MDQ4Mw==","name":"firebase-js-sdk","full_name":"firebase/firebase-js-sdk","owner":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","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-07-25T18:47:42Z","pushed_at":"2018-07-25T18:47:40Z","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":15864,"stargazers_count":1266,"watchers_count":1266,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":177,"open_issues":141,"watchers":1266,"default_branch":"master"}},"base":{"label":"firebase:firestore-multi-tab","ref":"firestore-multi-tab","sha":"548e2bb07ff8447a55fbbfa48f6bbbe8842cde37","user":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","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,"node_id":"MDEwOlJlcG9zaXRvcnk4OTI5MDQ4Mw==","name":"firebase-js-sdk","full_name":"firebase/firebase-js-sdk","owner":{"login":"firebase","id":1335026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzUwMjY=","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-07-25T18:47:42Z","pushed_at":"2018-07-25T18:47:40Z","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":15864,"stargazers_count":1266,"watchers_count":1266,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"archived":false,"open_issues_count":141,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":177,"open_issues":141,"watchers":1266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984"},"html":{"href":"https://github.com/firebase/firebase-js-sdk/pull/984"},"issue":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/984"},"comments":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/issues/984/comments"},"review_comments":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/pulls/984/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/984/commits"},"statuses":{"href":"https://api.github.com/repos/firebase/firebase-js-sdk/statuses/794e9f744d9cef341ece36930b32957e9c09320b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"schmidt-sebastian"}}