diff --git a/apps/server/src/services/plugin-catalog/plugin-catalog-service.ts b/apps/server/src/services/plugin-catalog/plugin-catalog-service.ts index 4f3a0e5fd0..50c6296464 100644 --- a/apps/server/src/services/plugin-catalog/plugin-catalog-service.ts +++ b/apps/server/src/services/plugin-catalog/plugin-catalog-service.ts @@ -441,9 +441,9 @@ export function createPluginCatalogService(deps: { // Bundled plugins are BB's own; attribute them like the seed entries. author: { name: "BB Team", url: "https://getbb.app" }, installed: getInstalledPlugin(deps.db, entry.pluginId) !== undefined, - // Bundled plugins are counted under their own entry id: telemetry sends - // a plugin_id for them too, so the curated sidecar names them alongside - // the entries it lists. + // Bundled plugins are counted under their canonical plugin id: telemetry + // sends that id too, so the curated sidecar names them alongside the + // entries it lists. installs, compatible: problem === null, incompatibleReason: problem, @@ -1180,7 +1180,7 @@ export function createPluginCatalogService(deps: { entry, manifest, icon?.hash ?? null, - curatedInstalls.get(entry.name) ?? null, + curatedInstalls.get(entry.pluginId) ?? null, ), }; }), diff --git a/apps/server/test/services/plugin-catalog/plugin-catalog-service.test.ts b/apps/server/test/services/plugin-catalog/plugin-catalog-service.test.ts index 886f2e8a0e..3404cacf61 100644 --- a/apps/server/test/services/plugin-catalog/plugin-catalog-service.test.ts +++ b/apps/server/test/services/plugin-catalog/plugin-catalog-service.test.ts @@ -634,13 +634,15 @@ describe("plugin catalog service", () => { } it("reports counts for curated entries and bundled plugins", async () => { - const bundled = listBundledPluginRegistrations()[0]; - if (bundled === undefined) throw new Error("no bundled plugin"); + const bundled = listBundledPluginRegistrations().find( + (plugin) => plugin.name === "docs" && plugin.pluginId === "simple-notes", + ); + if (bundled === undefined) throw new Error("docs registration missing"); const catalog = service({ fetch: fetchWith(() => statsResponse({ widgets: { installs: 4_210 }, - [bundled.name]: { installs: 12 }, + [bundled.pluginId]: { installs: 12 }, }), ), });