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");