From 87c3659381a09fd2594fec6239f944447e486c7b Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Tue, 5 Aug 2025 00:03:52 +0700 Subject: [PATCH 1/2] remove connect method --- package.json | 2 +- src/libs/actions/Session/index.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 150698b2b0ab..ffd00838a64f 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=319 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=317 --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", diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index 1df837bbc4f6..ef7693214b44 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -76,7 +76,8 @@ let authPromiseResolver: ((value: boolean) => void) | null = null; let isHybridAppSetupFinished = false; let hasSwitchedAccountInHybridMode = false; -Onyx.connect({ +// Use connectWithoutView because it doesn't get value to use in UI +Onyx.connectWithoutView({ key: ONYXKEYS.SESSION, callback: (value) => { session = value ?? {}; @@ -93,7 +94,8 @@ Onyx.connect({ }, }); -Onyx.connect({ +// Use connectWithoutView because it is only for fullstory initialization +Onyx.connectWithoutView({ key: ONYXKEYS.USER_METADATA, callback: Fullstory.consentAndIdentify, }); From 5a0bb45b275695b4a91c6cbbff772e422170a47a Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Tue, 19 Aug 2025 10:54:26 +0700 Subject: [PATCH 2/2] split --- package.json | 2 +- src/libs/actions/Session/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e1fbf572a08d..b8cc8e0374b5 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=252 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=253 --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", diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index e8fe102e3859..fc830a5dbb07 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -72,8 +72,7 @@ let authPromiseResolver: ((value: boolean) => void) | null = null; let hasSwitchedAccountInHybridMode = false; -// Use connectWithoutView because it doesn't get value to use in UI -Onyx.connectWithoutView({ +Onyx.connect({ key: ONYXKEYS.SESSION, callback: (value) => { session = value ?? {};