From 7ebe51218cd78dc1f01f666a72464b077894544c Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Thu, 28 Aug 2025 16:50:09 +0200 Subject: [PATCH 1/3] refactor: replaces Onyx.connect with Onyx.connectWithoutView in src/libs/actions/App.ts --- src/libs/actions/App.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index b84d75953924..49639a35f7a1 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -116,7 +116,9 @@ const KEYS_TO_PRESERVE: OnyxKey[] = [ ONYXKEYS.HYBRID_APP, ]; -Onyx.connect({ +// This functionality is triggered at application startup and provides the option to use it in emergency situations when +// you need to completely erase the Onyx data on the client due to it being in an invalid state. +Onyx.connectWithoutView({ key: ONYXKEYS.RESET_REQUIRED, callback: (isResetRequired) => { if (!isResetRequired) { From 4e5b67d8092efd9004d63916886a673893e7463c Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Mon, 1 Sep 2025 11:58:48 +0200 Subject: [PATCH 2/3] refactor: replaces Onyx.connect with Onyx.connectWithoutView in src/libs/actions/App.ts for ONYXKEYS.RESET_REQUIRED --- src/libs/actions/App.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 1e93f5554ea3..c5b40262f47c 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -116,8 +116,12 @@ const KEYS_TO_PRESERVE: OnyxKey[] = [ ONYXKEYS.HYBRID_APP, ]; -// This functionality is triggered at application startup and provides the option to use it in emergency situations when -// you need to completely erase the Onyx data on the client due to it being in an invalid state. +/* + * This listener allows you to reset the state stored in Onyx by changing the value under the ONYXKEYS.RESET_REQUIRED key. + * It is only used in emergencies when the entire state requires clearing. + * + * It has no direct impact on the View, making the use of Onyx.connectWithoutView justified in this case. + */ Onyx.connectWithoutView({ key: ONYXKEYS.RESET_REQUIRED, callback: (isResetRequired) => { From c86b6ab6d57abf3bf145e8253e5340c3b6ea645f Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Mon, 1 Sep 2025 15:13:33 +0200 Subject: [PATCH 3/3] chore: decrement number of max lint warnings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2297eb9aacb3..5162828ae406 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=216 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=215 --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",