From cf5ffacab3b48036970b115e7cdc1285fd6c0243 Mon Sep 17 00:00:00 2001 From: khaira777 <777gurkirat@gmail.com> Date: Sat, 7 Nov 2026 13:03:26 -0500 Subject: [PATCH 1/2] fix(shutdown): show All saved only after a successful backup backupOnShutdown ignored the backupForSession result and the deadline branch, so a failed, skipped or timed-out shutdown backup still showed All saved. It now shows the message only when the backup succeeded, and awaits it so holdStatus keeps it on screen before exit. --- main/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main/index.ts b/main/index.ts index 4d918fc0f..94bc27e95 100644 --- a/main/index.ts +++ b/main/index.ts @@ -1873,12 +1873,15 @@ function shouldShowShutdownStatus(): boolean { async function backupOnShutdown(): Promise { if (!shouldShowShutdownStatus() || !localBackup.isSessionBackupWanted()) return; // Stay well inside the coordinator's per-step timeout, which force-exits the app. - const deadline = new Promise((resolve) => { - setTimeout(resolve, SHUTDOWN_BACKUP_DEADLINE_MS).unref?.(); + const deadline = new Promise((resolve) => { + setTimeout(() => resolve(false), SHUTDOWN_BACKUP_DEADLINE_MS).unref?.(); }); void showStatus('shutdownBackup', true); - await Promise.race([localBackup.backupForSession(SESSION_BACKUP_MIN_AGE_MS, 5_000), deadline]); - void showStatus('saved', true); + const saved = await Promise.race([ + localBackup.backupForSession(SESSION_BACKUP_MIN_AGE_MS, 5_000), + deadline, + ]); + if (saved) await showStatus('saved', true); } const SHUTDOWN_BACKUP_DEADLINE_MS = 7_000; From 53fd368bddd200f84801669f431a97ddc30a1882 Mon Sep 17 00:00:00 2001 From: khaira777 <777gurkirat@gmail.com> Date: Sat, 7 Nov 2026 13:32:53 -0500 Subject: [PATCH 2/2] fix(shutdown): bound showStatus('saved') wait so stalled renderer cannot abort shutdown --- main/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/index.ts b/main/index.ts index 94bc27e95..1e1f40333 100644 --- a/main/index.ts +++ b/main/index.ts @@ -1881,7 +1881,14 @@ async function backupOnShutdown(): Promise { localBackup.backupForSession(SESSION_BACKUP_MIN_AGE_MS, 5_000), deadline, ]); - if (saved) await showStatus('saved', true); + if (saved) { + await Promise.race([ + showStatus('saved', true), + new Promise((resolve) => { + setTimeout(resolve, SHUTDOWN_MESSAGE_VISIBLE_MS).unref?.(); + }), + ]); + } } const SHUTDOWN_BACKUP_DEADLINE_MS = 7_000;