From fb2fce65026301a8a0b47c4718603f49239e0c5a Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:27:01 -0600 Subject: [PATCH] Fix app hanging if runAllSyncTasks() throws an error Co-authored-by: Jamie <113370520+jamiebuilds-signal@users.noreply.github.com> --- ts/background.preload.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ts/background.preload.ts b/ts/background.preload.ts index 938e2fa794..c863922bd5 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -1183,7 +1183,11 @@ export async function startApp(): Promise { ); } finally { setupAppState(); - drop(start()); + drop( + start().catch(error => { + log.error('start: threw an unexpected error', error); + }) + ); initializeNetworkObserver( window.reduxActions.network, () => window.getSocketStatus().authenticated.status @@ -1456,7 +1460,14 @@ export async function startApp(): Promise { } log.info('Expiration start timestamp cleanup: complete'); - await runAllSyncTasks(); + try { + await runAllSyncTasks(); + } catch (error) { + log.error( + 'runAllSyncTasks: threw an unexpected error during startup, continuing without processing remaining syncTasks', + error + ); + } cancelInitializationMessage();