Uninstall must not claim success with Docker quit - #9
Open
MasterYoav wants to merge 1 commit into
Open
MasterYoav wants to merge 1 commit into
MasterYoav wants to merge 1 commit into
Conversation
…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>
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.
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 insidetry?.AppStatethen 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.removeVolumesucceeded with the daemon down. Real Docker never does. The fake now refuses, and no other test depended on the dishonest behaviour.Fix:
RuntimeController.uninstall() -> Boolwakes the runtime first (ensureRuntimeReady, the same path start uses), then measures whether the volumes are gone.AppState.uninstall() -> Boolremoves nothing else on failure, so the keys and preferences survive and a retry from the same button works.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