Skip to content

#244: Fix unconfigurePack silently discarding failed removals#306

Merged
bguidolim merged 1 commit intomainfrom
bruno/244-unconfigure-failed-removal
Mar 27, 2026
Merged

#244: Fix unconfigurePack silently discarding failed removals#306
bguidolim merged 1 commit intomainfrom
bruno/244-unconfigure-failed-removal

Conversation

@bguidolim
Copy link
Copy Markdown
Collaborator

Summary

unconfigurePack() unconditionally cleared remaining.brewPackages and remaining.plugins after iterating removals, silently dropping failed items from the artifact record. Failed removals were never retried and users received no warning — leaving orphaned brew packages and plugins.

Closes #244

Changes

  • Replace unconditional remaining.brewPackages = [] / remaining.plugins = [] with per-item RefCountedRemovalResult switching
  • On .failed, keep the item in remaining and emit output.warn() so the end-of-method guard persists it for retry
  • Adopt the Set-collect-then-batch-remove pattern already used by MCP servers and files in the same method

Test plan

  • swift test passes locally (913 tests)
  • swiftformat --lint . and swiftlint pass without violations

- Replace unconditional array clears with per-item result switching
- Failed removals stay in artifact record for retry on next sync
- Adopt Set-collect-then-batch-remove pattern matching MCP/file removal
@bguidolim bguidolim merged commit 4cecad1 into main Mar 27, 2026
4 checks passed
@bguidolim bguidolim deleted the bruno/244-unconfigure-failed-removal branch March 27, 2026 22:08
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.

unconfigurePack silently discards failed brew/plugin removals

1 participant