Skip to content

Commit cf7d2b5

Browse files
Ignore primary lease loss in maybeGarbageCollectMultiClientState
This ignores the error if the primary lease is somehow lost between updateClientMetadataAndTryBecomePrimary() and maybeGarbageCollectMultiClientState(). There is no special recovery logic needed as the next primary will run the periodic GC. Fixes #2555
1 parent 277f355 commit cf7d2b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import { ReferenceSet } from './reference_set';
7272
import { ClientId } from './shared_client_state';
7373
import { TargetData } from './target_data';
7474
import { SimpleDb, SimpleDbStore, SimpleDbTransaction } from './simple_db';
75+
import {ignoreIfPrimaryLeaseLoss} from "./local_store";
7576

7677
const LOG_TAG = 'IndexedDbPersistence';
7778

@@ -489,7 +490,7 @@ export class IndexedDbPersistence implements Persistence {
489490
).next(() => inactive);
490491
});
491492
}
492-
);
493+
).catch(err => ignoreIfPrimaryLeaseLoss(err).then(() => []));
493494

494495
// Delete potential leftover entries that may continue to mark the
495496
// inactive clients as zombied in LocalStorage.

0 commit comments

Comments
 (0)