From ab61e7768b9cd5fe33111e674c9527fc8dcc7d10 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Wed, 27 Dec 2023 14:43:30 -0600 Subject: [PATCH] Ignore updates we already got --- src/libs/actions/OnyxUpdates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/OnyxUpdates.ts b/src/libs/actions/OnyxUpdates.ts index bc407625dc6a..6f9c98c91f9e 100644 --- a/src/libs/actions/OnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdates.ts @@ -72,8 +72,8 @@ function apply({lastUpdateID, type, request, response, updates}: Merge | 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)) {