From 8ab4c4e78d0b6b8e0717480aaab4fa09ba79f505 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:52:05 -0700 Subject: [PATCH] Postpone routineProfileRefresh until empty --- ts/background.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ts/background.ts b/ts/background.ts index a98ab5b71f..39c965ed2e 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2190,23 +2190,6 @@ export async function startApp(): Promise { window.storage.onready(async () => { idleDetector.start(); - - // Kick off a profile refresh if necessary, but don't wait for it, as failure is - // tolerable. - const ourConversationId = - window.ConversationController.getOurConversationId(); - if (ourConversationId) { - routineProfileRefresh({ - allConversations: window.ConversationController.getAll(), - ourConversationId, - storage: window.storage, - }); - } else { - assert( - false, - 'Failed to fetch our conversation ID. Skipping routine profile refresh' - ); - } }); if (!challengeHandler) { @@ -2347,6 +2330,23 @@ export async function startApp(): Promise { window.reduxActions.crashReports.setCrashReportCount( await window.crashReports.getCount() ); + + // Kick off a profile refresh if necessary, but don't wait for it, as failure is + // tolerable. + const ourConversationId = + window.ConversationController.getOurConversationId(); + if (ourConversationId) { + routineProfileRefresh({ + allConversations: window.ConversationController.getAll(), + ourConversationId, + storage: window.storage, + }); + } else { + assert( + false, + 'Failed to fetch our conversation ID. Skipping routine profile refresh' + ); + } } let initialStartupCount = 0;