From 25071fb282f7aa7faa7e3194d8a5ca20c647ace2 Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Tue, 2 Sep 2025 13:04:03 +0200 Subject: [PATCH 1/3] chore: decrement number of max eslint warnings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15ce4ae41b2d..10b7b5972a72 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", From db29264246863ec84a9cf49ffbce0fe90207ed3e Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Tue, 2 Sep 2025 13:05:15 +0200 Subject: [PATCH 2/3] refactor: replaces Onyx.connect with Onyx.connectWithoutView in src/libs/actions/App.ts for ONYXKEYS.COLLECTION.REPORT --- src/libs/actions/App.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a8fc974c3e79..a4f11094a86e 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -4,6 +4,7 @@ import type {AppStateStatus} from 'react-native'; import {AppState} from 'react-native'; import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; +import OnyxUtils from 'react-native-onyx/dist/OnyxUtils'; import * as API from '@libs/API'; import type {GetMissingOnyxMessagesParams, HandleRestrictedEventParams, OpenAppParams, OpenOldDotLinkParams, ReconnectAppParams, UpdatePreferredLocaleParams} from '@libs/API/parameters'; import {SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; @@ -80,8 +81,11 @@ Onyx.connect({ }, }); +// allReports is used in the "ForOpenOrReconnect" functions and is not directly associated with the View, +// so retrieving it using Onyx.connectWithoutView is correct. +// If this variable is ever needed for use in React components, it should be retrieved using useOnyx. let allReports: OnyxCollection; -Onyx.connect({ +Onyx.connectWithoutView({ key: ONYXKEYS.COLLECTION.REPORT, waitForCollectionCallback: true, callback: (value) => { From 5272033679050b768e25ee1bcc6ae3d9ea45aa2d Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 11:11:36 +0200 Subject: [PATCH 3/3] fix: fixes import issues in App.ts --- src/libs/actions/App.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a4f11094a86e..d8181705b5e9 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -4,7 +4,6 @@ import type {AppStateStatus} from 'react-native'; import {AppState} from 'react-native'; import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; -import OnyxUtils from 'react-native-onyx/dist/OnyxUtils'; import * as API from '@libs/API'; import type {GetMissingOnyxMessagesParams, HandleRestrictedEventParams, OpenAppParams, OpenOldDotLinkParams, ReconnectAppParams, UpdatePreferredLocaleParams} from '@libs/API/parameters'; import {SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; @@ -18,8 +17,8 @@ import {isPublicRoom, isValidReport} from '@libs/ReportUtils'; import {isLoggingInAsNewUser as isLoggingInAsNewUserSessionUtils} from '@libs/SessionUtils'; import {clearSoundAssetsCache} from '@libs/Sound'; import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; import type {OnyxKey} from '@src/ONYXKEYS'; +import ONYXKEYS from '@src/ONYXKEYS'; import type {Route} from '@src/ROUTES'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx';