File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
+ - [ changed] Improved iOS 13 support by eliminating an additional crash in our
3
+ IndexedDB persistence layer.
4
+
5
+ # 1.6.2
2
6
- [ changed] Fixed a crash on iOS 13 that occurred when persistence was enabled
3
7
in a background tab (#2232 ).
4
8
- [ fixed] Fixed an issue in the interaction with the Firestore Emulator that
5
9
caused requests with timestamps to fail.
10
+
11
+ # 1.6.0
6
12
- [ feature] Added a ` Firestore.onSnapshotsInSync() ` method that notifies you
7
13
when all your snapshot listeners are in sync with each other.
8
-
9
- # 1.6.0
10
14
- [ fixed] Fixed a regression that caused queries with nested field filters to
11
15
crash the client if the field was not present in the local copy of the
12
16
document.
Original file line number Diff line number Diff line change @@ -451,33 +451,30 @@ export class IndexedDbPersistence implements Persistence {
451
451
) {
452
452
this . lastGarbageCollectionTime = Date . now ( ) ;
453
453
454
- let activeClients : DbClientMetadata [ ] ;
455
- let inactiveClients : DbClientMetadata [ ] = [ ] ;
456
-
457
- await this . runTransaction (
454
+ const inactiveClients = await this . runTransaction (
458
455
'maybeGarbageCollectMultiClientState' ,
459
- 'readwrite-primary' ,
456
+ 'readwrite-primary-idempotent ' ,
460
457
txn => {
461
458
const metadataStore = IndexedDbPersistence . getStore <
462
459
DbClientMetadataKey ,
463
460
DbClientMetadata
464
461
> ( txn , DbClientMetadata . store ) ;
465
462
466
463
return metadataStore . loadAll ( ) . next ( existingClients => {
467
- activeClients = this . filterActiveClients (
464
+ const active = this . filterActiveClients (
468
465
existingClients ,
469
466
MAX_CLIENT_AGE_MS
470
467
) ;
471
- inactiveClients = existingClients . filter (
472
- client => activeClients . indexOf ( client ) === - 1
468
+ const inactive = existingClients . filter (
469
+ client => active . indexOf ( client ) === - 1
473
470
) ;
474
471
475
472
// Delete metadata for clients that are no longer considered active.
476
473
return PersistencePromise . forEach (
477
- inactiveClients ,
474
+ inactive ,
478
475
( inactiveClient : DbClientMetadata ) =>
479
476
metadataStore . delete ( inactiveClient . clientId )
480
- ) ;
477
+ ) . next ( ( ) => inactive ) ;
481
478
} ) ;
482
479
}
483
480
) ;
Original file line number Diff line number Diff line change @@ -303,6 +303,7 @@ export class SimpleDb {
303
303
isDomException ( e ) &&
304
304
attemptNumber < TRANSACTION_RETRY_COUNT ;
305
305
debug (
306
+ LOG_TAG ,
306
307
'Transaction failed with error: %s. Retrying: %s.' ,
307
308
e . message ,
308
309
retryable
You can’t perform that action at this time.
0 commit comments