diff --git a/src/libs/Network/SequentialQueue.ts b/src/libs/Network/SequentialQueue.ts index fb09f7f216bd..0f68855eb362 100644 --- a/src/libs/Network/SequentialQueue.ts +++ b/src/libs/Network/SequentialQueue.ts @@ -161,7 +161,10 @@ function flush() { resolveIsReadyPromise?.(); } currentRequest = null; - flushOnyxUpdatesQueue(); + // The queue can be paused when we sync the data with backend so we should only update the Onyx data when the queue is empty + if (PersistedRequests.getAll().length === 0) { + flushOnyxUpdatesQueue(); + } }); }, }); @@ -179,7 +182,6 @@ function unpause() { const numberOfPersistedRequests = PersistedRequests.getAll().length || 0; console.debug(`[SequentialQueue] Unpausing the queue and flushing ${numberOfPersistedRequests} requests`); isQueuePaused = false; - flushOnyxUpdatesQueue(); flush(); }