diff --git a/lib/Onyx.ts b/lib/Onyx.ts index d6d011f3..d99649e6 100644 --- a/lib/Onyx.ts +++ b/lib/Onyx.ts @@ -427,7 +427,7 @@ function merge(key: TKey, changes: OnyxMergeInput): * @param collection Object collection keyed by individual collection member keys and values */ function mergeCollection(collectionKey: TKey, collection: OnyxMergeCollectionInput): Promise { - // Gracefully handle bad mergeCollection updates so it doesn't block the merge queue + // Gracefully handle bad mergeCollection updates, so it doesn't block the merge queue if (!OnyxUtils.isValidMergeCollection(collectionKey, collection)) { return Promise.resolve(); } diff --git a/lib/OnyxUtils.ts b/lib/OnyxUtils.ts index 175ff469..dea4a357 100644 --- a/lib/OnyxUtils.ts +++ b/lib/OnyxUtils.ts @@ -23,6 +23,7 @@ import type { OnyxEntry, OnyxInput, OnyxKey, + OnyxMergeCollectionInput, OnyxValue, Selector, WithOnyxConnectOptions, @@ -1112,7 +1113,7 @@ function initializeWithDefaultKeyStates(): Promise { /** * Verify if the collection is valid for merging into the collection key using mergeCollection() */ -function isValidMergeCollection(collectionKey: TKey, collection: Collection>): boolean { +function isValidMergeCollection(collectionKey: TKey, collection: OnyxMergeCollectionInput): boolean { if (typeof collection !== 'object' || Array.isArray(collection) || utils.isEmptyObject(collection)) { Logger.logInfo('mergeCollection() called with invalid or empty value. Skipping this update.'); return false; diff --git a/lib/types.ts b/lib/types.ts index 669256ba..e6a6c0ec 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -436,8 +436,8 @@ type GenericFunction = (...args: any[]) => any; * Represents a combination of Merge and Set operations that should be executed in Onyx */ type MixedOperationsQueue = { - merge: NullableKeyValueMapping; - set: NullableKeyValueMapping; + merge: OnyxInputKeyValueMapping; + set: OnyxInputKeyValueMapping; }; export type {