From 38c8764366f6ed012a8f06283555047dadc6b987 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Thu, 18 Jul 2024 20:28:02 +0200 Subject: [PATCH] Merge pull request #45709 from Expensify/ionatan_logoutdatedclient Log when onyx updates is outdated (cherry picked from commit 806fd8f2ed2405e7d9f3ba53504d9079b55593b6) --- src/libs/actions/OnyxUpdates.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdates.ts b/src/libs/actions/OnyxUpdates.ts index 91cdde6a7c64..73c8b3d592bf 100644 --- a/src/libs/actions/OnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdates.ts @@ -163,10 +163,15 @@ function doesClientNeedToBeUpdated(previousUpdateID = 0, clientLastUpdateID = 0) // If we don't have any value in lastUpdateIDFromClient, this is the first time we're receiving anything, so we need to do a last reconnectApp if (!lastUpdateIDFromClient) { + Log.info('We do not have lastUpdateIDFromClient, client needs updating'); + return true; + } + if (lastUpdateIDFromClient < previousUpdateID) { + Log.info('lastUpdateIDFromClient is less than the previousUpdateID received, client needs updating', false, {lastUpdateIDFromClient, previousUpdateID}); return true; } - return lastUpdateIDFromClient < previousUpdateID; + return false; } // eslint-disable-next-line import/prefer-default-export