Skip to content

restore single update toast and cover updater transitions#299

Merged
AmethystLiang merged 3 commits intomainfrom
fix-updater-2
Apr 4, 2026
Merged

restore single update toast and cover updater transitions#299
AmethystLiang merged 3 commits intomainfrom
fix-updater-2

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • remove the extra fixed update reminder and restore the previous single Sonner toast flow
  • keep the 36-hour background updater scheduling unchanged in main
  • extract the renderer updater toast state machine into a controller with regression tests for real status sequences

Testing

  • Not run locally: this worktree does not have node_modules installed, so vitest/typecheck cannot run here

@AmethystLiang AmethystLiang changed the title fix: restore single update toast and cover updater transitions restore single update toast and cover updater transitions Apr 4, 2026
- Replace smart quote (U+2019) with ASCII apostrophe in update toast test
- Use .at(-1) instead of array[length - 1] per prefer-at rule
- Extract background context menu into FileExplorerBgMenu to fix max-lines
The old UpdateReminder component checked dismissedUpdateVersion before
showing the update prompt. This logic was missing from the new
createUpdateToastController, causing the toast to reappear even after
the user dismissed it. Now the controller skips the available toast when
the version matches the dismissed one and persists the dismissal when
the user closes the toast without clicking Update.
@AmethystLiang AmethystLiang merged commit 8e9b505 into main Apr 4, 2026
1 check passed
AmethystLiang added a commit that referenced this pull request Apr 5, 2026
PR #299 introduced a regression where the one-click auto-update flow
would synchronously invoke `quitAndInstall` immediately upon receiving
the `downloaded` state transition. This triggered a synthetic `beforeunload`
event (to capture terminal buffers) and an IPC call to quit in the exact
same event loop tick that React and the Toast library were processing
state updates. This disrupted the renderer's synchronous shutdown and flush
logic, causing the app to fail to quit and install properly.

This adds a `setTimeout` to defer `quitAndInstall`, pushing it to the
bottom of the event queue. This allows the UI state to settle and ensures
the `beforeunload` flush sequence executes cleanly.
Test cases have also been updated to use fake timers.
AmethystLiang added a commit that referenced this pull request Apr 5, 2026
* fix: defer updater quitAndInstall to allow React/UI state to settle

PR #299 introduced a regression where the one-click auto-update flow
would synchronously invoke `quitAndInstall` immediately upon receiving
the `downloaded` state transition. This triggered a synthetic `beforeunload`
event (to capture terminal buffers) and an IPC call to quit in the exact
same event loop tick that React and the Toast library were processing
state updates. This disrupted the renderer's synchronous shutdown and flush
logic, causing the app to fail to quit and install properly.

This adds a `setTimeout` to defer `quitAndInstall`, pushing it to the
bottom of the event queue. This allows the UI state to settle and ensures
the `beforeunload` flush sequence executes cleanly.
Test cases have also been updated to use fake timers.

* fix: centralize updater restart deferral in main process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant