From ae3eea67f42daa25f06b343aa400c696a70809a1 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Thu, 31 Jul 2025 18:53:30 +0530 Subject: [PATCH 1/3] update usage to `connectWithoutView` --- src/libs/actions/OnyxUpdateManager/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdateManager/utils/index.ts b/src/libs/actions/OnyxUpdateManager/utils/index.ts index 3bba28f6c18d..3516abb09218 100644 --- a/src/libs/actions/OnyxUpdateManager/utils/index.ts +++ b/src/libs/actions/OnyxUpdateManager/utils/index.ts @@ -9,7 +9,7 @@ import {applyUpdates} from './applyUpdates'; import {clear, enqueue, getUpdates} from './DeferredOnyxUpdates'; let lastUpdateIDAppliedToClient: number = CONST.DEFAULT_NUMBER_ID; -Onyx.connect({ +Onyx.connectWithoutView({ key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, callback: (value) => (lastUpdateIDAppliedToClient = value ?? CONST.DEFAULT_NUMBER_ID), }); From d92a30d99f2f2eb6b5cda383ab264fb7fee7250d Mon Sep 17 00:00:00 2001 From: Gandalf Date: Thu, 31 Jul 2025 18:55:55 +0530 Subject: [PATCH 2/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bd9828532d5..9be43ceff0bb 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand", "perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure", "typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc", - "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=324 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=323 --cache --cache-location=node_modules/.cache/eslint", "lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", From f6f7f82440a159b5512679625f6fed63b5382e66 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Fri, 1 Aug 2025 11:34:14 +0530 Subject: [PATCH 3/3] add comment --- src/libs/actions/OnyxUpdateManager/utils/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/actions/OnyxUpdateManager/utils/index.ts b/src/libs/actions/OnyxUpdateManager/utils/index.ts index 3516abb09218..62081ec0ec8f 100644 --- a/src/libs/actions/OnyxUpdateManager/utils/index.ts +++ b/src/libs/actions/OnyxUpdateManager/utils/index.ts @@ -9,6 +9,8 @@ import {applyUpdates} from './applyUpdates'; import {clear, enqueue, getUpdates} from './DeferredOnyxUpdates'; let lastUpdateIDAppliedToClient: number = CONST.DEFAULT_NUMBER_ID; + +// We have used `connectWithoutView` here because OnyxUpdates is not connected to any UI Onyx.connectWithoutView({ key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT, callback: (value) => (lastUpdateIDAppliedToClient = value ?? CONST.DEFAULT_NUMBER_ID),