fix: replace intrusive update modal with toast and fix double-restart bug#841
Merged
charlesvien merged 2 commits intomainfrom Feb 7, 2026
Merged
fix: replace intrusive update modal with toast and fix double-restart bug#841charlesvien merged 2 commits intomainfrom
charlesvien merged 2 commits intomainfrom
Conversation
Replace the modal dialog for manual update checks with toast notifications to match the automatic update notification UX. Now all update notifications use the same toast pattern: - Checking: persistent toast with spinner - Up to date: 3s auto-dismiss toast - Error: 4s auto-dismiss toast - Update ready: persistent toast with action buttons (already done) This provides a consistent, non-intrusive experience whether updates are found automatically or via manual check from the menu.
Contributor
Author
|
closes #814 |
charlesvien
approved these changes
Feb 7, 2026
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.
Problem
Root Cause of Double-Restart Bug
The
installUpdate()method calledshutdown()which tore down the DI container beforequitAndInstall()triggered thebefore-quitevent. When thebefore-quithandler tried to access the container, it threw an error, preventing a clean quit. On a second press,shutdown()sees_isShuttingDown=trueand callsforceExit(), killing the process without the updater installing.Changes
1. Fix double-restart bug
cleanupForUpdate()method toAppLifecycleServicethat does essential cleanup (killing processes, shutting down watchers) without tearing down the DI containerUpdatesService.installUpdate()to:isQuittingForUpdateflag FIRSTcleanupForUpdate()instead ofshutdown()quitAndInstall()This ensures the container stays intact for the
before-quithandler while still properly cleaning up processes and watchers.2. Replace update modal with persistent toast
UpdatePrompt.tsxto show a persistent toast (duration: Infinity) in the bottom right when an update is ready3. Update tests
cleanupForUpdatemock to lifecycle service testssetQuittingForUpdate()→cleanupForUpdate()→quitAndInstall()shutdown()is NOT called during update installationTesting
Automated
Manual Testing (Production Build Required)
Updates are only enabled in packaged/production builds, so manual testing requires:
Test the toast notification:
Test single-restart:
Test "Later" action:
Files Modified
apps/twig/src/main/services/app-lifecycle/service.ts- addedcleanupForUpdate()methodapps/twig/src/main/services/updates/service.ts- fixed install flowapps/twig/src/main/services/updates/service.test.ts- updated testsapps/twig/src/renderer/components/UpdatePrompt.tsx- replaced modal with toast