File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
packages/auth/src/platform_browser/persistence Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @firebase/auth ' : patch
3
+ ---
4
+
5
+ Protection from enumerating an empty list in Auth's reading of IndexedDB results, as this causes errors in some macOS and iOS browser runtimes.
Original file line number Diff line number Diff line change @@ -369,13 +369,16 @@ class IndexedDBLocalPersistence implements InternalPersistence {
369
369
370
370
const keys = [ ] ;
371
371
const keysInResult = new Set ( ) ;
372
- for ( const { fbase_key : key , value } of result ) {
373
- keysInResult . add ( key ) ;
374
- if ( JSON . stringify ( this . localCache [ key ] ) !== JSON . stringify ( value ) ) {
375
- this . notifyListeners ( key , value as PersistenceValue ) ;
376
- keys . push ( key ) ;
372
+ if ( result . length !== 0 ) {
373
+ for ( const { fbase_key : key , value } of result ) {
374
+ keysInResult . add ( key ) ;
375
+ if ( JSON . stringify ( this . localCache [ key ] ) !== JSON . stringify ( value ) ) {
376
+ this . notifyListeners ( key , value as PersistenceValue ) ;
377
+ keys . push ( key ) ;
378
+ }
377
379
}
378
380
}
381
+
379
382
for ( const localKey of Object . keys ( this . localCache ) ) {
380
383
if ( this . localCache [ localKey ] && ! keysInResult . has ( localKey ) ) {
381
384
// Deleted
You can’t perform that action at this time.
0 commit comments