Skip to content

Commit c5b79b6

Browse files
Ignore primary lease loss in maybeGarbageCollectMultiClientState (#2585)
1 parent 277f355 commit c5b79b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ 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-
7675
const LOG_TAG = 'IndexedDbPersistence';
7776

7877
/**
@@ -489,7 +488,13 @@ export class IndexedDbPersistence implements Persistence {
489488
).next(() => inactive);
490489
});
491490
}
492-
);
491+
).catch(() => {
492+
// Ignore primary lease violations or any other type of error. The next
493+
// primary will run `maybeGarbageCollectMultiClientState()` again.
494+
// We don't use `ignoreIfPrimaryLeaseLoss()` since we don't want to depend
495+
// on LocalStore.
496+
return [];
497+
});
493498

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

0 commit comments

Comments
 (0)