Repository navigation
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoShow “All saved” only after a successful shutdown backup
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
…not abort shutdown
Related work
Issue / Discussion: None (follow-up from an audit of recent main commits, finding F-06a/b)
Summary
backupOnShutdownignored thebackupForSessionresult and the 7s deadline branch, and always ranvoid showStatus('saved', true). A failed, skipped or timed-out shutdown backup therefore still showed "All saved". The unawaited call also racedholdStatus(SHUTDOWN_MESSAGE_VISIBLE_MS), which measures frommessageAt, so after a slow backup the message could flash or never paint before exit.Now the deadline resolves to
false, "All saved" is shown only when the backup succeeded, and that call is awaited soholdStatuskeeps it visible. On failure the window keeps "Taking a backup" until exit. The database itself is already durable, and the startup session backup retries on the next launch becauseisSessionBackupWantedis still true.Scope
No new status message (adding one would need translations in all 27 status tables).
localBackup.stop()ordering is unchanged; it does not affect the shutdown backup, which uses its own AbortController.Verification
Commands run:
npm run lint,npm run buildnpm run test:status-messages,npm run test:local-backup,npm run test:shutdown-lifecycleoxfmt --check main/index.ts,git diff --checkResults: all passed. Not run: a manual quit of a packaged app with a forced backup failure.
backupOnShutdownis private tomain/index.ts, so there is no unit test.Time budget: the 7s backup deadline plus the 450ms
MIN_DWELL_MSplus oneexecuteJavaScriptstays within the 10sSHUTDOWN_TIMEOUT_MSper-step limit.Compatibility & data safety
Cross-cutting surfaces
Developer documentation
Contributor checklist