fix(integrations): send no recovery for an incident the first run recorded silently

The watchdog's first pass after a deploy records standing incidents as
announced without paging. Their end then sent a recovery note for
something the operator was never told about. Such incidents now carry
the epoch as their announcement time, which no real announcement can
have, and close without a note.
This commit is contained in:
Marc-André Bombeck committed 2026-10-15 16:42:41 +02:00
1 parent 6dd71f0103
commit 346825149d
4 files changed
+61 -3

No files matched your search

@@ -4,6 +4,7 @@ import {
NORMAL_DELIVERY_MIN_DAYS,
SOURCE_PROFILES,
classifySilence,
FIRST_RUN_ALERTED_AT,
currentIncident,
decideWatchTransition,
type WatchRow,
@@ -293,6 +294,27 @@ describe("currentIncident", () => {
});
});
describe("decideWatchTransition: an incident recorded on the first run", () => {
it("closes without a recovery note, since none was ever sent", () => {
expect(
decideWatchTransition({
row: {
silentSince: ago(30),
incidentReason: "unexpected_silence",
incidentOpenedAt: ago(2),
alertedAt: FIRST_RUN_ALERTED_AT,
},
incident: null,
ledgerAlerted: false,
}),
).toEqual({
kind: "close",
notify: false,
previousReason: "unexpected_silence",
});
});
});
describe("decideWatchTransition", () => {
const incident = { reason: "unexpected_silence" as const, since: ago(30) };