From 8edf1886bd245cf62fc505dd734fc7a3b7fbca1e Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 19 Sep 2023 17:05:12 +0800 Subject: [PATCH 1/2] adding OR check --- src/libs/actions/OnyxUpdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdates.ts b/src/libs/actions/OnyxUpdates.ts index 50a4fdffc3ae..ffbadbed3e25 100644 --- a/src/libs/actions/OnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdates.ts @@ -65,7 +65,7 @@ function apply({lastUpdateID, type, request, response, updates}: OnyxUpdatesFrom console.debug('[OnyxUpdateManager] Update received was older than current state, returning without applying the updates'); return Promise.resolve(); } - if (lastUpdateID && lastUpdateIDAppliedToClient && Number(lastUpdateID) > lastUpdateIDAppliedToClient) { + if (lastUpdateID && (lastUpdateIDAppliedToClient == null || Number(lastUpdateID) > lastUpdateIDAppliedToClient)) { Onyx.merge(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, Number(lastUpdateID)); } if (type === CONST.ONYX_UPDATE_TYPES.HTTPS && request && response) { From 80c249594a1772acc37bc75bb1f004a6dc8ff72e Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 19 Sep 2023 17:20:48 +0800 Subject: [PATCH 2/2] adding tripple equal --- src/libs/actions/OnyxUpdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdates.ts b/src/libs/actions/OnyxUpdates.ts index ffbadbed3e25..39a20ae9362a 100644 --- a/src/libs/actions/OnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdates.ts @@ -65,7 +65,7 @@ function apply({lastUpdateID, type, request, response, updates}: OnyxUpdatesFrom console.debug('[OnyxUpdateManager] Update received was older than current state, returning without applying the updates'); return Promise.resolve(); } - if (lastUpdateID && (lastUpdateIDAppliedToClient == null || Number(lastUpdateID) > lastUpdateIDAppliedToClient)) { + if (lastUpdateID && (lastUpdateIDAppliedToClient === null || Number(lastUpdateID) > lastUpdateIDAppliedToClient)) { Onyx.merge(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, Number(lastUpdateID)); } if (type === CONST.ONYX_UPDATE_TYPES.HTTPS && request && response) {