0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/crates/update/tests
Wing 644961c842 Remote updates can't strand a Mac whose engine came from an earlier update
On Nov 11 a remote "Update all" took m1-laptop offline for 2.5 hours. Its
background engine (app closed) had become 0.2.138 as an update's trial, so
it ran from /Applications/.Zeron.app.new-<id>, which the commit renamed to
Zeron.app; macOS keeps naming the executable by the old path. Asked for the
next update, the engine stopped, and the boot after shutdown that should
have become the new version didn't recognise its own installation
(Layout::whoami: neither the bundle nor the new incoming), returned, and the
process exited. Nothing starts an engine with the app closed.

- whoami: an executable in an earlier incoming bundle that no longer exists
  is the installed bundle (became_the_bundle).
- The watchdog starts from the installed binary when this process's own path
  is gone; through `sh -c '"$@" &'` a missing path meant a trial with no
  watchdog and no rollback.
- The background engine only stops for an update when it will start the
  trial itself (transaction::starts_here); otherwise the update is reported
  failed and it keeps serving.
- If it stopped for an update and nothing was handed over, it fails the
  update and execs the installed engine in place instead of exiting.

Tests: a headless engine that came from an earlier update carries out the
next one in the same process; a next release that dies on trial is rolled
back and the installed engine comes back up (both run real processes in a
macOS bundle layout, and fail without the fix); whoami/starts_here units.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-11-10 23:54:40 -07:00
..
update_transaction.rs Remote updates can't strand a Mac whose engine came from an earlier update 2026-11-10 23:54:40 -07:00