File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ function init({
109109
110110 // Initialize all of our keys with data provided then give green light to any pending connections.
111111 // addEvictableKeysToRecentlyAccessedList must run after initializeWithDefaultKeyStates because
112- // eager cache loading populates the key index (cache.setAllKeys ) inside initializeWithDefaultKeyStates,
112+ // eager cache loading populates the key index (cache.hydrate ) inside initializeWithDefaultKeyStates,
113113 // and the evictable keys list depends on that index being populated.
114114 OnyxUtils . initializeWithDefaultKeyStates ( )
115115 . then ( ( ) => cache . addEvictableKeysToRecentlyAccessedList ( OnyxKeys . isCollectionKey , OnyxUtils . getAllKeys ) )
Original file line number Diff line number Diff line change @@ -1042,7 +1042,8 @@ function initializeWithDefaultKeyStates(): Promise<void> {
10421042 // Load all storage data into cache silently (no subscriber notifications).
10431043 // hydrate() rather than merge(): the cache is empty at this point, so a per-key fastMerge
10441044 // would only deep-clone every row it was handed.
1045- cache . setAllKeys ( Object . keys ( allDataFromStorage ) ) ;
1045+ // No setAllKeys() call is needed: hydrate() calls addKey() for every key, which populates the
1046+ // key index and registers collection member keys itself.
10461047 cache . hydrate ( allDataFromStorage ) ;
10471048
10481049 // For keys that have a developer-defined default (via `initialKeyStates`), merge the
You can’t perform that action at this time.
0 commit comments