mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* fix(updater): keep one .Hex-update folder, not one per staged dev build Every staged release unpacked its own `.Hex-update-<version>` folder beside `Hex.app`, and the only removal was `finish_on_launch`. The Dev channel checks every ten minutes, so a Hex that runs for days staged a full ~80 MB copy of the app per published build and left every one of them in `/Applications` (the folder it replaces was never removed); the launch sweep only ran when Hex next started, which for a menu-bar app can be days. Staging a newer release now removes the folder of the one it replaces, once the replacement is the staged update, so a running install holds exactly one folder and the app can never be caught without its staged update. The launch sweep stays as the safety net for a swap or an interrupted stage, and now skips symlinks (never followed) and the running bundle itself. The sweep moved to `updater/staging.rs` so it can be tested off macOS: `launch_cleanup_removes_every_unpacked_update_but_the_running_bundle`, `a_newer_update_removes_the_folder_of_the_one_it_replaces`, `a_bundle_running_from_a_staging_folder_keeps_that_folder`, and `a_symlink_named_like_a_staged_update_is_never_followed`, plus the macOS-only `a_newer_staged_release_removes_the_folder_of_the_one_it_replaces`. Observed on macOS 26 with the published 0.0.0-dev-1046 build: the launch sweep removed both a folder holding an older signed build and one holding a swapped-in peer beside /Applications/Hex.app. * fix(updater): never stage a release after a quit installed one a quit installs the staged update itself (`install_on_quit`) while the updater thread can still be in `check()`. two things went wrong in that window: - the late `check` overwrote `shared.staged`, and its `remove_superseded` then deleted the folder holding the bundle the quit had just replaced (the one the draining process runs from), orphaning the release it had unpacked. - `finish_restart` swapped again after `install_on_quit` had applied the update, exchanging the same two bundles back and losing the update. `check` now takes the state and staged locks together, in the order `install_on_quit` takes them, and refuses a release that lands while quitting or after `State::Applied`: it removes the folder it unpacked and keeps the installed update. `finish_restart` reports done without swapping once the state is Applied. The macOS `discard` helper removes that unused folder. `staging::remove_beside` now canonicalizes the bundle's folder and compares the kept folder by name (only when its own folder resolves there), so a `..`, `./`, or symlinked spelling still names the folder to keep, and a path outside it protects nothing. tests: `a_restart_after_a_quit_installed_the_update_does_not_swap_again` (fails without the Applied guard), `a_release_that_finishes_staging_after_a_quit_installed_one_is_discarded` (fails when the decision adopts everything), and `the_folder_to_keep_is_recognized_through_a_non_canonical_spelling` (fails with the old raw path comparison). |
||
| .. | ||
| legacy.rs | ||
| linux.rs | ||
| macos.rs | ||
| notes.rs | ||
| protocol.rs | ||
| staging.rs | ||
| transport.rs | ||
| windows.rs | ||