Skip to content

Commit

Permalink
Merge pull request Expensify#33666 from Expensify/ionatan_donotapplys…
Browse files Browse the repository at this point in the history
…ameupdate

Ignore updates we already got
  • Loading branch information
iwiznia authored Jan 3, 2024
2 parents 4ff30c7 + ab61e77 commit 4a86066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/OnyxUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function apply({lastUpdateID, type, request, response, updates}: Merge<OnyxUpdat
function apply({lastUpdateID, type, request, response, updates}: OnyxUpdatesFromServer): Promise<void | Response> | undefined {
Log.info(`[OnyxUpdateManager] Applying update type: ${type} with lastUpdateID: ${lastUpdateID}`, false, {command: request?.command});

if (lastUpdateID && lastUpdateIDAppliedToClient && Number(lastUpdateID) < lastUpdateIDAppliedToClient) {
Log.info('[OnyxUpdateManager] Update received was older than current state, returning without applying the updates', false);
if (lastUpdateID && lastUpdateIDAppliedToClient && Number(lastUpdateID) <= lastUpdateIDAppliedToClient) {
Log.info('[OnyxUpdateManager] Update received was older or the same than current state, returning without applying the updates', false);
return Promise.resolve();
}
if (lastUpdateID && (lastUpdateIDAppliedToClient === null || Number(lastUpdateID) > lastUpdateIDAppliedToClient)) {
Expand Down

0 comments on commit 4a86066

Please sign in to comment.