Repository navigation
fix(electron): keep the backup-on-quit notification on screen before exit - #387
Merged
Merged
Conversation
…exit Electron removes a process's delivered notifications from Notification Center when the app exits, so the backup done/failed notification posted during quit could vanish before it was seen. Hold app.exit until the backup result has been shown for 4 s (overlapping the runtime shutdown), still bounded by the 45 s hard quit timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QJtaJyUDKFXsJBGWyqGCE
Coverage Report for backend
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by EraPartner · project thread
Summary
After ⌘Q, the "backup done" notification no longer appears, though the backup runs. Tor's
main.loghas no quit timeout or failure after 2026-10-19, and encrypted.visionbakfiles were written on 2026-10-28. The launch notification ("Vision is running") still shows, so macOS permission is not the cause.Cause (partly inference): on macOS, Electron removes the notifications a process delivered when that process exits. The quit path posts the backup notification and then exits (
packaging/electron/main.ts, will-quit handler), so the notification can disappear before anyone sees it. Evidence that Electron does this:main,CocoaNotification::~CocoaNotificationcallsremoveDeliveredNotificationsWithIdentifiers, and the presenter deletes its live notifications when it is destroyed.Fix:
notify()now returns theNotificationit posts.whenNotificationSeen()waits until the notification'sshowevent plus 4 s, or 4 s ifshownever fires.app.exitwaits for that after a backup-on-quit result. The runtime shutdown runs during the wait.Type of change
fix— bug fixChecklist
bun run typecheck:electron,bun run typecheck)Architecture & data
Verification
bun run typecheck:electron: clean.eslint -c eslint.projects.config.mjs packaging/electron/main.ts: clean.bun run test:electron: 213 tests, 211 pass, 0 fail.Residual risk & follow-ups
Generated by Claude Code