Skip to content

Commit 25c8ccf

Browse files
committed
fix(webapp): name a watched error in full, not truncated
1 parent 4f26e67 commit 25c8ccf

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

apps/webapp/app/components/dashboard-agent/wake-banner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ describe("wakePresentation", () => {
145145
note: "",
146146
};
147147
expect(wakePresentation("fired", { ...error, resolution: "condition_met" })).toMatchObject({
148-
headline: "Error a1b2c3d4 happened again",
148+
headline: "Error a1b2c3d4e5f6 happened again",
149149
category: "attention",
150150
});
151151
expect(wakePresentation("expired", { ...error, resolution: "window_completed" })).toMatchObject(
152-
{ headline: "Error a1b2c3d4 stayed quiet", category: "positive" }
152+
{ headline: "Error a1b2c3d4e5f6 stayed quiet", category: "positive" }
153153
);
154154
});
155155

apps/webapp/app/components/dashboard-agent/watch-card.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,17 @@ describe("the card's copy", () => {
270270
expect(watchSubjectLabel(healthWatchRecommendation("warn"))).toBe("health");
271271
});
272272

273-
it("says the kind once, though the fingerprint carries it too", () => {
274-
// Fingerprints are stored prefixed (`error_c4b4a797397a9c43`), so shortening the
275-
// raw value would read "error error_c4".
273+
it("says the kind once, and names the error in full", () => {
274+
// Fingerprints are stored prefixed (`error_c4b4a797397a9c43`), so the raw value
275+
// would read "error error_c4b4a797397a9c43".
276276
expect(
277277
watchSubjectLabel({
278278
kind: "error_recurrence",
279279
fingerprint: "error_c4b4a797397a9c43",
280280
checkEveryMinutes: 5,
281281
maxHours: 0.5,
282282
})
283-
).toBe("error c4b4a797");
283+
).toBe("error c4b4a797397a9c43");
284284
});
285285

286286
it("states the condition and the duration as §2.2 writes them", () => {

apps/webapp/app/components/dashboard-agent/watch-chips.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("watchChipLabel", () => {
3737
).toBe("task/send-email");
3838
});
3939

40-
it("shortens an error fingerprint", () => {
40+
it("labels an error watch by its fingerprint, in full", () => {
4141
expect(
4242
watchChipLabel(
4343
chip({
@@ -48,7 +48,7 @@ describe("watchChipLabel", () => {
4848
checkEveryMinutes: 15,
4949
})
5050
)
51-
).toBe("01234567");
51+
).toBe("0123456789abcdef0123456789abcdef");
5252
});
5353

5454
it("labels a health watch by its kind, not its report", () => {

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@ import {
3232
/** The micro-label above a wake headline. Not part of the fact. */
3333
export const WATCH_UPDATE_LABEL = "Watch update";
3434

35-
/** Fingerprints are hashes, so show just enough to tell them apart. */
36-
const FINGERPRINT_CHARS = 8;
37-
3835
/**
3936
* A fingerprint carries its own `error_` prefix, and every surface names the kind
40-
* itself — so the prefix is dropped before shortening, or the line reads
41-
* "error error_c4".
37+
* itself — so the prefix is dropped, or the line reads "error error_c4b4a797397a9c43".
38+
* The rest is shown whole: a truncated hash is not something anyone can look up.
4239
*/
4340
export function shortFingerprint(fingerprint: string): string {
44-
return fingerprint.replace(/^error_/, "").slice(0, FINGERPRINT_CHARS);
41+
return fingerprint.replace(/^error_/, "");
4542
}
4643

4744
/* ------------------------------------------------------------------ *

0 commit comments

Comments
 (0)