@@ -305,9 +305,7 @@ export class IndexedDbPersistence implements Persistence {
305
305
this . simpleDb = db ;
306
306
// NOTE: This is expected to fail sometimes (in the case of another tab already
307
307
// having the persistence lock), so it's the first thing we should do.
308
- return this . updateClientMetadataAndTryBecomePrimary (
309
- this . forceOwningTab
310
- ) ;
308
+ return this . updateClientMetadataAndTryBecomePrimary ( ) ;
311
309
} )
312
310
. then ( ( ) => {
313
311
if ( ! this . isPrimary && ! this . allowTabSynchronization ) {
@@ -404,9 +402,7 @@ export class IndexedDbPersistence implements Persistence {
404
402
* primary state listener if the client either newly obtained or released its
405
403
* primary lease.
406
404
*/
407
- private updateClientMetadataAndTryBecomePrimary (
408
- forceOwningTab = false
409
- ) : Promise < void > {
405
+ private updateClientMetadataAndTryBecomePrimary ( ) : Promise < void > {
410
406
return this . runTransaction (
411
407
'updateClientMetadataAndTryBecomePrimary' ,
412
408
'readwrite' ,
@@ -446,15 +442,15 @@ export class IndexedDbPersistence implements Persistence {
446
442
}
447
443
)
448
444
. catch ( e => {
445
+ if ( isIndexedDbTransactionError ( e ) ) {
446
+ logDebug ( LOG_TAG , 'Failed to extend owner lease: ' , e ) ;
447
+ // Proceed with the existing state. Any subsequent access to
448
+ // IndexedDB will verify the lease.
449
+ return this . isPrimary ;
450
+ }
451
+
449
452
if ( ! this . allowTabSynchronization ) {
450
- if ( isIndexedDbTransactionError ( e ) ) {
451
- logDebug ( LOG_TAG , 'Failed to extend owner lease: ' , e ) ;
452
- // Proceed with the existing state. Any subsequent access to
453
- // IndexedDB will verify the lease.
454
- return this . isPrimary ;
455
- } else {
456
- throw e ;
457
- }
453
+ throw e ;
458
454
}
459
455
460
456
logDebug (
0 commit comments