Skip to content

Commit 35ae489

Browse files
jincheng-xydtclaude
andcommitted
fix: warn when previously installed plugin disappears from discovery
When a plugin like Slack is externalized from bundled to npm, the upgrade path can silently drop it from the installed plugin index with no diagnostic output. Users only discover the issue when the channel stops working. Add a console.warn when a previously-installed plugin is no longer found in the current discovery results, including the previous path and a hint about plugins.allow. Fixes #91873 Co-Authored-By: Claude <[email protected]>
1 parent cd2d837 commit 35ae489

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/plugins/installed-plugin-index-invalidation.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ export function diffInstalledPluginIndexInvalidationReasons(
3535
for (const [pluginId, previousPlugin] of previousByPluginId) {
3636
const currentPlugin = currentByPluginId.get(pluginId);
3737
if (!currentPlugin) {
38+
// A previously installed plugin is no longer in the discovery results.
39+
// This can happen when a bundled plugin is externalized (e.g. Slack)
40+
// or the plugin was uninstalled. Log a warning so users can diagnose
41+
// the issue rather than discovering the plugin silently disappeared.
42+
console.warn(
43+
`plugin ${pluginId}: previously installed plugin not found in discovery ` +
44+
`(previous path: ${previousPlugin.rootDir ?? "unknown"}). ` +
45+
`If this was unexpected, check that the plugin is still installed and ` +
46+
`configured in plugins.allow.`,
47+
);
3848
reasons.add("source-changed");
3949
continue;
4050
}

0 commit comments

Comments
 (0)