From fac5173a18d6d46d5fe3b758717ab5820b96b63e Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Thu, 31 Jul 2025 20:09:02 +0530 Subject: [PATCH 1/2] Replaced Onyx.connect with Onyx.connectWithoutView in e2eLogin --- package.json | 2 +- src/libs/E2E/actions/e2eLogin.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0bd9828532d5..e9767e53805d 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=322 --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/E2E/actions/e2eLogin.ts b/src/libs/E2E/actions/e2eLogin.ts index c1d3a7d20338..a81305920f78 100644 --- a/src/libs/E2E/actions/e2eLogin.ts +++ b/src/libs/E2E/actions/e2eLogin.ts @@ -25,7 +25,7 @@ const e2eUserCredentials = { export default function (): Promise { const waitForBeginSignInToFinish = (): Promise => new Promise((resolve) => { - const id = Onyx.connect({ + const id = Onyx.connectWithoutView({ key: ONYXKEYS.CREDENTIALS, callback: (credentials) => { // beginSignUp writes to credentials.login once the API call is complete @@ -43,7 +43,7 @@ export default function (): Promise { // Subscribe to auth token, to check if we are authenticated return new Promise((resolve, reject) => { - const connection = Onyx.connect({ + const connection = Onyx.connectWithoutView({ key: ONYXKEYS.SESSION, callback: (session) => { if (session?.authToken == null || session.authToken.length === 0) { From c319bdb9092bf75bf05cd5d31d2871db60b0b4a9 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal <58412969+shubham1206agra@users.noreply.github.com> Date: Fri, 1 Aug 2025 21:51:04 +0530 Subject: [PATCH 2/2] Apply suggestions from code review --- src/libs/E2E/actions/e2eLogin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/E2E/actions/e2eLogin.ts b/src/libs/E2E/actions/e2eLogin.ts index a81305920f78..a57aa9cb261f 100644 --- a/src/libs/E2E/actions/e2eLogin.ts +++ b/src/libs/E2E/actions/e2eLogin.ts @@ -25,6 +25,7 @@ const e2eUserCredentials = { export default function (): Promise { const waitForBeginSignInToFinish = (): Promise => new Promise((resolve) => { + // We opted for `connectWithoutView` here as this is being used for mocking data for E2E flow. const id = Onyx.connectWithoutView({ key: ONYXKEYS.CREDENTIALS, callback: (credentials) => { @@ -43,6 +44,7 @@ export default function (): Promise { // Subscribe to auth token, to check if we are authenticated return new Promise((resolve, reject) => { + // We opted for `connectWithoutView` here as this is being used for mocking data for E2E flow. const connection = Onyx.connectWithoutView({ key: ONYXKEYS.SESSION, callback: (session) => {