Skip to content

Commit 97a260f

Browse files
committed
Add some logs before Queue is pause
1 parent 36a723f commit 97a260f

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Onyx from 'react-native-onyx';
22
import type {DeferredUpdatesDictionary} from '@libs/actions/OnyxUpdateManager/types';
3+
import Log from '@libs/Log';
34
import * as SequentialQueue from '@libs/Network/SequentialQueue';
45
import CONST from '@src/CONST';
56
import ONYXKEYS from '@src/ONYXKEYS';
@@ -78,6 +79,7 @@ type EnqueueDeferredOnyxUpdatesOptions = {
7879
*/
7980
function enqueue(updates: OnyxUpdatesFromServer | DeferredUpdatesDictionary, options?: EnqueueDeferredOnyxUpdatesOptions) {
8081
if (options?.shouldPauseSequentialQueue ?? true) {
82+
Log.info('[DeferredOnyxUpdates] Pausing SequentialQueue');
8183
SequentialQueue.pause();
8284
}
8385

src/libs/actions/User.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ function subscribeToUserEvents() {
906906
updates: pushEventData.updates ?? [],
907907
previousUpdateID: Number(pushJSON.previousUpdateID ?? CONST.DEFAULT_NUMBER_ID),
908908
};
909+
Log.info('[subscribeToUserEvents] Applying Onyx updates');
909910
applyOnyxUpdatesReliably(updates);
910911
});
911912

src/libs/actions/applyOnyxUpdatesReliably.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Log from '@libs/Log';
12
import * as SequentialQueue from '@libs/Network/SequentialQueue';
23
import CONST from '@src/CONST';
34
import type {OnyxUpdatesFromServer} from '@src/types/onyx';
@@ -20,6 +21,7 @@ type ApplyOnyxUpdatesReliablyOptions = {
2021
*/
2122
export default function applyOnyxUpdatesReliably(updates: OnyxUpdatesFromServer, {shouldRunSync = false, clientLastUpdateID}: ApplyOnyxUpdatesReliablyOptions = {}) {
2223
const fetchMissingUpdates = () => {
24+
Log.info('[applyOnyxUpdatesReliably] Fetching missing updates');
2325
// If we got here, that means we are missing some updates on our local storage. To
2426
// guarantee that we're not fetching more updates before our local data is up to date,
2527
// let's stop the sequential queue from running until we're done catching up.

0 commit comments

Comments
 (0)