Skip to content

Commit ab7d796

Browse files
committed
merge: watch-wording shortFingerprint review-comment fixes
2 parents 28b8183 + d2704fa commit ab7d796

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

internal-packages/dashboard-agent-contracts/src/watch-wording.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export function watchConditionWording(spec: WatchSpec): WatchConditionWording {
463463
label: "If it happens again",
464464
clause: "in case it happens again",
465465
tooltip: "Get notified if this error happens again",
466-
note: `ping me if error ${spec.fingerprint} happens again`,
466+
note: `ping me if error ${shortFingerprint(spec.fingerprint)} happens again`,
467467
};
468468
case "health_recovery":
469469
return {

internal-packages/dashboard-agent-contracts/src/watch.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
type WatchKind,
2424
type WatchSpec,
2525
} from "./watch.js";
26-
import { watchResolvedBlockBody } from "./watch-wording.js";
26+
import { watchConditionWording, watchResolvedBlockBody } from "./watch-wording.js";
2727

2828
const common = { maxHours: 6, note: "because I asked" };
2929

@@ -611,3 +611,17 @@ describe("watchResolvedBlockBody", () => {
611611
).toBe("impossible");
612612
});
613613
});
614+
615+
describe("watchConditionWording", () => {
616+
it("shortens the fingerprint in the error-recurrence note", () => {
617+
const note = watchConditionWording({
618+
...common,
619+
kind: "error_recurrence",
620+
fingerprint: "error_c4b4",
621+
checkEveryMinutes: 15,
622+
}).note;
623+
624+
expect(note).not.toContain("error error_");
625+
expect(note).toBe("ping me if error c4b4 happens again");
626+
});
627+
});

0 commit comments

Comments
 (0)