mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
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:
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) };
|
||||
|
||||
|
||||
Reference in new issue
Block a user