Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error due to incorrect dependency update after plugin deletion #576

Open
guqing opened this issue Mar 29, 2024 · 1 comment
Open

Error due to incorrect dependency update after plugin deletion #576

guqing opened this issue Mar 29, 2024 · 1 comment
Assignees
Labels

Comments

@guqing
Copy link

guqing commented Mar 29, 2024

Description

While managing plugins with p4fj, I encountered an issue where the dependency relationship of a deleted plugin was not correctly updated. Specifically, after deleting a plugin that other plugins depend on, attempting to stop those dependent plugins results in an error, stating Plugin 'hello-plugin' not found, despite hello-plugin having been deleted.

Steps to Reproduce

  1. Assume there are two plugins: one named welcome-plugin and another named hello-plugin, with hello-plugin depending on welcome-plugin.
  2. Start all plugins.
  3. Stop and delete the hello-plugin:
    pluginManager.stopPlugin("hello-plugin");
    pluginManager.deletePlugin("hello-plugin");
  4. Then, stop the welcome-plugin.

Expected Behavior

After hello-plugin has been deleted, welcome-plugin should stop without any errors, unaffected by any dependency issues.

Actual Behavior

When attempting to stop welcome-plugin, the error Plugin 'hello-plugin' not found occurs. This error is due to the plugin manager's dependencyResolver still referencing the uninstalled hello-plugin.

Dependency Graphs

  • dependenciesGraph:
    welcome-plugin -> []
    hello-plugin -> [welcome-plugin]
    
  • dependentsGraph:
    welcome-plugin -> [hello-plugin]
    hello-plugin -> []
    

Possible Solution

Update the dependency graphs upon plugin deletion to ensure all dependencies and dependents are correctly handled.

Environment Information

v3.11.0

If I have misunderstood, please correct me 🫡

@decebals
Copy link
Member

decebals commented Apr 1, 2024

Thank you for your detailed description.
I will investigate.
A unit test that highlighted the problem simplifies the investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants