Skip to content

Commit e41a695

Browse files
fix(server): drop what a plugin registered before its activation failed
A plugin whose activate registered handlers and then threw kept those handlers live, kept its activation signal open, and was later deactivated as if it had started. A failed activation now clears its handlers, aborts its signal and leaves the plugin unactivated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 4e32e8f commit e41a695

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/server/src/plugins/pluginHostChild.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ export const runPluginHostChild = (): void => {
130130
await module.activate(context);
131131
send({ _tag: "Ready" });
132132
} catch (error) {
133+
// A plugin that failed to activate serves nothing it registered before
134+
// failing, and is not deactivated later as if it had started.
135+
activated = undefined;
136+
handlers.clear();
137+
controller.abort(new Error("Activation failed."));
133138
send({ _tag: "ActivationFailed", message: errorMessage(error) });
134139
}
135140
};

0 commit comments

Comments
 (0)