Files
orca/src
Jinjing 6b18a1ce28 fix: centralize updater restart deferral in main process (#313)
* 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
2026-04-05 13:34:25 -07:00
..