diff --git a/src/infra/restart-sentinel.test.ts b/src/infra/restart-sentinel.test.ts index 8816376624c..e69cdfb5baf 100644 --- a/src/infra/restart-sentinel.test.ts +++ b/src/infra/restart-sentinel.test.ts @@ -210,6 +210,29 @@ describe("formatRestartSentinelUserMessage", () => { expect(formatRestartSentinelUserMessage(payload)).toBe("Gateway restart failed."); }); + it("returns skipped message for skipped status", () => { + const payload = { + kind: "update" as const, + status: "skipped" as const, + ts: Date.now(), + }; + expect(formatRestartSentinelUserMessage(payload)).toBe( + "Gateway restart skipped (no restart was performed).", + ); + }); + + it("returns skipped message for skipped status even with a note", () => { + const payload = { + kind: "update" as const, + status: "skipped" as const, + ts: Date.now(), + message: "update already up to date", + }; + const result = formatRestartSentinelUserMessage(payload); + expect(result).toBe("Gateway restart skipped (no restart was performed)."); + expect(result).not.toContain("already up to date"); + }); + it("never includes doctorHint", () => { const payload = { kind: "config-patch" as const, diff --git a/src/infra/restart-sentinel.ts b/src/infra/restart-sentinel.ts index 3feb660088b..c15e2aee7cb 100644 --- a/src/infra/restart-sentinel.ts +++ b/src/infra/restart-sentinel.ts @@ -137,6 +137,9 @@ export function formatRestartSentinelUserMessage(payload: RestartSentinelPayload if (payload.status === "error") { return "Gateway restart failed."; } + if (payload.status === "skipped") { + return "Gateway restart skipped (no restart was performed)."; + } return "Gateway restarted successfully."; }