Fix uninstallable flag after discarding changes

After uninstalling a plugin (without restart) and then discarding the
changes, plugins which are required for the plugin can be uninstalled
even if the uninstallation was reverted. This was caused by not updating
the dependency relations between the plugins when an uninstallation has
been canceled. Therefore, the updating step is added.
This commit is contained in:
Laura Gorzitze
2024-02-13 18:02:54 +01:00
parent ec14d4cbd5
commit 46c52cdb99
4 changed files with 34 additions and 1 deletions

View File

@@ -390,6 +390,7 @@ public class DefaultPluginManager implements PluginManager {
PluginPermissions.write().check();
pendingUninstallQueue.forEach(PendingPluginUninstallation::cancel);
pendingInstallQueue.forEach(PendingPluginInstallation::cancel);
pendingUninstallQueue.forEach(pendingPluginUninstallation -> dependencyTracker.addInstalled(pendingPluginUninstallation.getPlugin().getDescriptor()));
pendingUninstallQueue.clear();
pendingInstallQueue.clear();
updateMayUninstallFlag();

View File

@@ -53,4 +53,8 @@ class PendingPluginUninstallation {
throw new PluginFailedToCancelInstallationException("failed to cancel uninstallation", name, ex);
}
}
InstalledPlugin getPlugin() {
return plugin;
}
}