Skip to content

Commit 3073f60

Browse files
Ignore IndexedDB failure during lease refresh
1 parent da3582b commit 3073f60

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,16 @@ export class IndexedDbPersistence implements Persistence {
412412
})
413413
.catch(e => {
414414
if (!this.allowTabSynchronization) {
415-
throw e;
416-
}
415+
if (e.name === 'IndexedDbTransactionError') {
416+
logDebug(LOG_TAG, "Failed to extend owner lease: ", e);
417+
// Proceed in primary mode since the client was not initialized
418+
// to support multi-tab. Any subsequent access to IndexedDB will
419+
// verify the lease.
420+
return true;
421+
} else {
422+
throw e;
423+
}
424+
}
417425

418426
logDebug(
419427
LOG_TAG,

0 commit comments

Comments
 (0)