mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
* 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