Skip to content

🐛 Add reverse dependency check on plugin removal#244

Merged
Nlkomaru merged 2 commits intomainfrom
fix/232-reverse-dependency-check-on-removal
Mar 28, 2026
Merged

🐛 Add reverse dependency check on plugin removal#244
Nlkomaru merged 2 commits intomainfrom
fix/232-reverse-dependency-check-on-removal

Conversation

@Nlkomaru
Copy link
Copy Markdown
Member

Summary

  • Block plugin removal when other plugins have sync: dependencies on the target
  • Add --force flag to mpm remove command to override the check
  • Preserve ABI compatibility with overloaded remove() method in public API
  • Log warning when force-removing a plugin with dependents

Test plan

  • Verify mpm remove PluginA is blocked when PluginB has sync:PluginA
  • Verify mpm remove PluginA --force succeeds with warning
  • Verify mpm remove PluginC works normally when no dependents exist

Closes #232

- Check getPluginsSyncingTo() before removing a plugin
- Block removal if other plugins have sync dependencies on the target
- Add --force flag to RemoveCommand for overriding the check
- Add MpmError.PluginError.HasDependents error type
- Preserve ABI compatibility with overloaded remove() method
- Log warning when force-removing a plugin with dependents

Closes #232
@github-actions
Copy link
Copy Markdown
Contributor

@Nlkomaru Nlkomaru merged commit 7ad6107 into main Mar 28, 2026
9 checks passed
@Nlkomaru Nlkomaru deleted the fix/232-reverse-dependency-check-on-removal branch March 28, 2026 12:24
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 779d893ae6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +66 to +69
suspend fun remove(
name: PluginName,
force: Boolean
): Either<MpmError, Unit>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep new remove overload non-abstract for API compatibility

PluginLifecycleService is part of the published mpm-api artifact, and this change adds remove(name, force) as a new abstract method; any third-party implementation compiled against the previous API will not implement it, so mpm remove (now calling the 2-arg overload) can fail at runtime with AbstractMethodError when such an implementation is wired in. To actually preserve compatibility, the new overload should provide a default body (or delegate in the opposite direction) instead of introducing a required abstract member.

Useful? React with 👍 / 👎.

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.

🐛 No reverse dependency check on plugin removal

1 participant