Skip to content

Commit 85e8606

Browse files
authored
Merge pull request Expensify#67716 from DylanDylann/remove-connect-method-in-SequentialQueue
2 parents bbd362a + 0bbe517 commit 85e8606

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=288 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=285 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

src/libs/Network/SequentialQueue.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import type {ConflictData} from '@src/types/onyx/Request';
2121
import {isOffline, onReconnection} from './NetworkStore';
2222

2323
let shouldFailAllRequests: boolean;
24-
Onyx.connect({
24+
// Use connectWithoutView since this is for network data and don't affect to any UI
25+
Onyx.connectWithoutView({
2526
key: ONYXKEYS.NETWORK,
2627
callback: (network) => {
2728
if (!network) {
@@ -78,7 +79,8 @@ function flushOnyxUpdatesQueue() {
7879

7980
let queueFlushedDataToStore: OnyxUpdate[] = [];
8081

81-
Onyx.connect({
82+
// Use connectWithoutView since this is for network queue and don't affect to any UI
83+
Onyx.connectWithoutView({
8284
key: ONYXKEYS.QUEUE_FLUSHED_DATA,
8385
callback: (val) => {
8486
if (!val) {
@@ -227,7 +229,8 @@ function flush(shouldResetPromise = true) {
227229
}
228230

229231
// Ensure persistedRequests are read from storage before proceeding with the queue
230-
const connection = Onyx.connect({
232+
// Use connectWithoutView since this is for network queue and don't affect to any UI
233+
const connection = Onyx.connectWithoutView({
231234
key: ONYXKEYS.PERSISTED_REQUESTS,
232235
// We exceptionally opt out of reusing the connection here to avoid extra callback calls due to
233236
// an existing connection already made in PersistedRequests.ts.

0 commit comments

Comments
 (0)