Skip to content

Commit d67338a

Browse files
authored
Merge pull request Expensify#657 from callstack-internal/bugfix/merge-updates
Rollback to push all `merge` operations to `update()` final promise instead of the first one
2 parents efeb267 + 45db60c commit d67338a

File tree

2 files changed

+432
-433
lines changed

2 files changed

+432
-433
lines changed

lib/Onyx.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,9 @@ function update(data: OnyxUpdate[]): Promise<void> {
612612
return;
613613
}
614614

615-
const mergePromises = operations.map((operation) => {
616-
return merge(key, operation);
615+
operations.forEach((operation) => {
616+
promises.push(() => merge(key, operation));
617617
});
618-
promises.push(() => mergePromises.at(0) ?? Promise.resolve());
619618
});
620619

621620
const snapshotPromises = OnyxUtils.updateSnapshots(data, merge);

0 commit comments

Comments
 (0)