Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(plugins): stop interrupting for official auto-updates

tianma-if3ec61d706da3
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index f3af17e9..dba67be7 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -806,17 +806,11 @@ export const WorkspaceApp = ({
running = true;
try {
const marketplace = await loadResolvedPluginMarketplace();
- const result = await updateOfficialMarketplacePlugins(pluginHost, marketplace.entries);
+ await updateOfficialMarketplacePlugins(pluginHost, marketplace.entries);
const firstResolutionError = Object.entries(marketplace.resolutionErrors)[0];
if (firstResolutionError) {
console.error(`Official plugin ${firstResolutionError[0]} update resolution failed.`, firstResolutionError[1]);
}
- if (active && result.updated.length > 0) {
- setAppNoticeDialog({
- title: t("plugins.noticeTitle"),
- description: t("plugins.updates.officialAutoUpdated", { count: result.updated.length }),
- });
- }
} catch (error) {
console.error("Official plugin update check failed.", error);
} finally {
@@ -832,7 +826,7 @@ export const WorkspaceApp = ({
window.clearInterval(intervalId);
window.removeEventListener("focus", handleFocus);
};
- }, [pluginHost, pluginHostReady, t]);
+ }, [pluginHost, pluginHostReady]);
const scheduledTasksQuery = useQuery({
queryKey: ["scheduled-tasks", scheduledTaskDeviceId],
queryFn: () => api.listScheduledTasks(scheduledTaskDeviceId ?? undefined),
diff --git a/apps/web/src/lib/plugins/plugin-updates.test.mjs b/apps/web/src/lib/plugins/plugin-updates.test.mjs
index 8e928383..7eca61b4 100644
--- a/apps/web/src/lib/plugins/plugin-updates.test.mjs
+++ b/apps/web/src/lib/plugins/plugin-updates.test.mjs
@@ -1,4 +1,5 @@
import { describe, expect, test } from "bun:test";
+import { readFileSync } from "node:fs";
import { checkInstalledExtensionUpdate, checkPluginUpdates, updateOfficialMarketplacePlugins } from "./plugin-updates.ts";
const pluginManifest = {
@@ -121,3 +122,12 @@ describe("plugin update checks", () => {
expect(result.updated.map((update) => update.pluginId)).toEqual([pluginManifest.id]);
});
});
+
+describe("official plugin auto-update workspace notice", () => {
+ test("updates silently without interrupting the workspace", () => {
+ const workspace = readFileSync(new URL("../../components/WorkspaceApp.tsx", import.meta.url), "utf8");
+ expect(workspace).toContain("updateOfficialMarketplacePlugins");
+ expect(workspace).not.toContain("officialAutoUpdated");
+ expect(workspace).not.toContain("result.updated.length");
+ });
+});
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index b208b45f..bd85b5ab 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -736,7 +736,6 @@ export const enUS = {
addedPermissions: "New capability declarations",
addedNetworkHosts: "New website declarations (legacy metadata)",
allowAndUpdate: "Confirm and update",
- officialAutoUpdated: "Updated {{count}} official plugin(s) to the latest verified version.",
},
noticeTitle: "Plugin",
panel: "Plugin panel",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 10f6aef3..db8c967a 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -736,7 +736,6 @@ export const zhCN = {
addedPermissions: "新增能力声明",
addedNetworkHosts: "新增网站声明(旧版元数据)",
allowAndUpdate: "确认并更新",
- officialAutoUpdated: "已将 {{count}} 个官方插件自动更新至最新验证版本。",
},
noticeTitle: "插件",
panel: "插件面板",