Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(updates): apply deferred component updates when package downloaded

zipgd3b3a4dbd615
diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue
index a97b0bb1cd..0dbc6329bc 100644
--- a/apps/desktop/src/App.vue
+++ b/apps/desktop/src/App.vue
@@ -1317,6 +1317,15 @@ async function updateAllAvailable() {
reportComponentUpdateResult(await componentUpdates.installCategories(categories));
return;
}
+ if (action === "defer-components") {
+ const remembered = await rememberComponentUpdatesForRestartedApp({ kind: "manual", categories });
+ if (remembered) {
+ toast(t("settings.updateRestartHint"), 6000);
+ return;
+ }
+ reportComponentUpdateResult(await componentUpdates.installCategories(categories));
+ return;
+ }
if (action === "download-app") await downloadUpdateInBackground();
if (updateDownloaded.value || updateReady.value) await rememberComponentUpdatesForRestartedApp({ kind: "manual", categories });
} finally {
diff --git a/apps/desktop/src/lib/updates/__tests__/componentUpdateOrchestration.spec.ts b/apps/desktop/src/lib/updates/__tests__/componentUpdateOrchestration.spec.ts
index 781364c2c1..27953f9cb7 100644
--- a/apps/desktop/src/lib/updates/__tests__/componentUpdateOrchestration.spec.ts
+++ b/apps/desktop/src/lib/updates/__tests__/componentUpdateOrchestration.spec.ts
@@ -79,6 +79,14 @@ describe("component update orchestration", () => {
expect(resolveUpdateAllAction({ hasAppUpdate: true, appUpdateCanInstall: true, appUpdatePrepared: true, hasComponentUpdates: true })).toBe("defer-components");
});
+ it("persists the selected component categories when the DBX package is already prepared", () => {
+ const action = resolveUpdateAllAction({ hasAppUpdate: true, appUpdateCanInstall: true, appUpdatePrepared: true, hasComponentUpdates: true });
+ expect(action).toBe("defer-components");
+
+ expect(markPendingComponentUpdatesAfterAppUpdate("0.6.16", "0.6.17", { kind: "manual", categories: ["drivers", "mcp"] })).toBe(true);
+ expect(takePendingComponentUpdatesAfterAppRestart("0.6.17")?.plan).toEqual({ kind: "manual", categories: ["drivers", "mcp"] });
+ });
+
it("updates components immediately when no DBX update exists or the package cannot be installed", () => {
expect(resolveUpdateAllAction({ hasAppUpdate: false, appUpdateCanInstall: true, appUpdatePrepared: false, hasComponentUpdates: true })).toBe("update-components");
expect(resolveUpdateAllAction({ hasAppUpdate: true, appUpdateCanInstall: false, appUpdatePrepared: false, hasComponentUpdates: true })).toBe("update-components");