fix(update): skip plugins switched through ClawHub

This commit is contained in:
Vincent Koc
2026-07-12 06:36:57 -07:00
parent 79ca96cd66
commit 1ac22971f7
2 changed files with 30 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import {
resolvePostCoreUpdateChildStdio,
resolvePostUpdateServiceStateReadEnv,
resolvePostInstallDoctorEnv,
resolvePostSyncPluginUpdateSkipIds,
shouldPrepareUpdatedInstallRestart,
resolveUpdatedGatewayRestartPort,
shouldUseLegacyProcessRestartAfterUpdate,
@@ -541,6 +542,18 @@ describe("collectMissingPluginInstallPayloads", () => {
});
});
describe("resolvePostSyncPluginUpdateSkipIds", () => {
it("skips plugins already switched through ClawHub or npm and repaired payloads", () => {
expect(
resolvePostSyncPluginUpdateSkipIds({
switchedToClawHub: ["whatsapp"],
switchedToNpm: ["voice-call"],
repairedMissingPayloadIds: new Set(["telegram"]),
}),
).toStrictEqual(new Set(["whatsapp", "voice-call", "telegram"]));
});
});
describe("shouldUseLegacyProcessRestartAfterUpdate", () => {
it("never restarts package updates through the pre-update process", () => {
expect(shouldUseLegacyProcessRestartAfterUpdate({ updateMode: "npm" })).toBe(false);