fix: make macOS desktop self-update swap+relaunch fail-fast and recoverable - #74
Closed
OmarB97 wants to merge 2 commits into
Closed
fix: make macOS desktop self-update swap+relaunch fail-fast and recoverable#74OmarB97 wants to merge 2 commits into
OmarB97 wants to merge 2 commits into
Conversation
🔎 Lint report:
|
Owner
Author
|
Closing: superseded by fork PR #75 mirroring upstream NousResearch#38446 from branch fix/macos-bootstrap-reseal. |
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.
Why
The in-app "Update now" flow on macOS can quit the app and never reinstall/reopen, leaving the user with a dead-end. This is a known failure mode: the bundled swap script did not fail fast when
dittoor the destination replace failed, and did not clean up/inspect the swap on failure. A related systemic gap isstate.db unavailable: database is lockedunder concurrent Python writers, which surfaces in the TUI.What changed
apps/desktop/electron/main.cjs: replaced the old swap script with a fail-fast, trap-cleanup version that falls back to launching the rebuilt bundle directly if the bundle swap fails, so the user never sees a silent dead quit.hermes_state.py: addedPRAGMA busy_timeout = 5000so concurrent writers pause instead of trippingdatabase is locked.How to review
Review the diff in
apps/desktop/electron/main.cjsaroundapplyUpdatesPosixInAppand the single-line change inhermes_state.py.__init__. No behavior changes outside the macOS updater swap path and SQLite open path.Evidence
Pre-fix symptom: Clicking "Update now" quits
/Applications/Hermes.app, no reluanch, no installed bundle on retry.Post-fix expectation: if the swap to
/Applications/Hermes.appfails, the builtrelease/mac-arm64/Hermes.appis opened directly; if it succeeds,/Applications/Hermes.appis replaced and reopened.Verification
hermes updateor in-app Update Hermes flow succeeds.[updates] ditto failedor[updates] destination replace failedand the rebuilt.appis opened.state.db unavailable: database is locked; TUI Sessions tab no longer hangs.Risks & gaps
state.dbconnections; if a writer holds a lock for >5s it will still error, but that is far better than immediate failure./Applications/Hermes.app; subsequent launches may still need the manual bundle swap if/Applicationsis the canonical path.