Skip to content

Uninstall must not claim success with Docker quit - #9

Open
MasterYoav wants to merge 1 commit into
masterfrom
uninstall-wakes-runtime
Open

MasterYoav wants to merge 1 commit into
masterfrom
uninstall-wakes-runtime

Conversation

@MasterYoav

Copy link
Copy Markdown
Owner

Bug: with Docker Desktop quit or the Colima VM stopped — likely on the day someone removes an app — RuntimeController.uninstall() ran every removal against no daemon, each failing silently inside try?. AppState then wiped the Keychain and preferences and the screen said "Everything xBot stored has been removed" over gigabytes of volumes still on disk. Invariant 7 (degrade honestly), broken on the one action that can't be undone.

Why no test caught it: FakeDriver.removeVolume succeeded with the daemon down. Real Docker never does. The fake now refuses, and no other test depended on the dishonest behaviour.

Fix:

  • RuntimeController.uninstall() -> Bool wakes the runtime first (ensureRuntimeReady, the same path start uses), then measures whether the volumes are gone.
  • AppState.uninstall() -> Bool removes nothing else on failure, so the keys and preferences survive and a retry from the same button works.
  • Settings → Advanced says the data couldn't be removed and why, instead of claiming success.

Tests first: a stopped-but-startable runtime is woken and emptied; a runtime that won't start returns false with volumes intact. Full Swift suite green. docs/11 updated.

🤖 Generated with Claude Code

…hing.

Every removal ran against no daemon inside a try?, then the keys and
preferences were wiped and the screen announced success over every volume
still on disk. It now wakes the runtime first, measures what is left, and
on failure keeps the keys so the same button works again.

The fake driver removed volumes with no daemon, which real Docker never
does — that is why no test could see this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant