Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Jun 9, 2024
1 parent ca3cd29 commit 7dd7e77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Onyx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function merge<TKey extends OnyxKey>(key: TKey, changes: OnyxMergeInput<TKey>):
* @param collection Object collection keyed by individual collection member keys and values
*/
function mergeCollection<TKey extends CollectionKeyBase, TMap>(collectionKey: TKey, collection: OnyxMergeCollectionInput<TKey, TMap>): Promise<void> {
// 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();
}
Expand Down
3 changes: 2 additions & 1 deletion lib/OnyxUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type {
OnyxEntry,
OnyxInput,
OnyxKey,
OnyxMergeCollectionInput,
OnyxValue,
Selector,
WithOnyxConnectOptions,
Expand Down Expand Up @@ -1112,7 +1113,7 @@ function initializeWithDefaultKeyStates(): Promise<void> {
/**
* Verify if the collection is valid for merging into the collection key using mergeCollection()
*/
function isValidMergeCollection<TKey extends CollectionKeyBase, TMap>(collectionKey: TKey, collection: Collection<TKey, TMap, NullishDeep<KeyValueMapping[TKey]>>): boolean {
function isValidMergeCollection<TKey extends CollectionKeyBase, TMap>(collectionKey: TKey, collection: OnyxMergeCollectionInput<TKey, TMap>): 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;
Expand Down
4 changes: 2 additions & 2 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7dd7e77

Please sign in to comment.