{"record":{"id":"263b9f35cd1389d8","repo":"paperclipai/paperclip","slug":"plugin-pluginid-must-provide-a-non-empty-even","errorCode":null,"errorMessage":"Plugin \"${pluginId}\" must provide a non-empty event name.","messagePattern":"Plugin \"(.+?)\" must provide a non-empty event name\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-event-bus.ts","lineNumber":253,"sourceCode":"          handler = maybeFn;\n        }\n\n        subsFor(pluginId).push({ eventPattern, filter, handler });\n      },\n\n      /**\n       * Emit a plugin-namespaced event. The event type is automatically\n       * prefixed with `plugin.<pluginId>.` so:\n       * - `emit(\"sync-done\", payload)` becomes `\"plugin.acme.linear.sync-done\"`.\n       *\n       * Requires the `events.emit` capability (enforced by the host layer).\n       *\n       * @throws {Error} if `name` already contains the `plugin.` prefix\n       *   (prevents cross-namespace spoofing).\n       */\n      async emit(name: string, companyId: string, payload: unknown): Promise<PluginEventBusEmitResult> {\n        if (!name || name.trim() === \"\") {\n          throw new Error(`Plugin \"${pluginId}\" must provide a non-empty event name.`);\n        }\n\n        if (!companyId || companyId.trim() === \"\") {\n          throw new Error(`Plugin \"${pluginId}\" must provide a companyId when emitting events.`);\n        }\n\n        if (name.startsWith(\"plugin.\")) {\n          throw new Error(\n            `Plugin \"${pluginId}\" must not include the \"plugin.\" prefix when emitting events. ` +\n            `Emit the bare event name (e.g. \"sync-done\") and the bus will namespace it automatically.`,\n          );\n        }\n\n        const eventType = `plugin.${pluginId}.${name}` as const;\n        const event: PluginEvent = {\n          eventId: crypto.randomUUID(),\n          eventType,\n          companyId,","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-event-bus.ts#L235-L271","documentation":"Input guard in emit: the event name is empty or whitespace. The bus derives the full event type by prefixing plugin.<pluginId>., and an empty base name would produce an unroutable event; the empty name argument is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-event-bus.ts:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty event name when emitting plugin events."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}