mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 22:50:51 +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
@@ -333,6 +333,24 @@ describe("what pages and what does not", () => {
|
||||
expect(second.firstRun).toBe(false);
|
||||
expect(dispatchNotification).not.toHaveBeenCalled();
|
||||
|
||||
// It ends without a recovery note: nothing was ever sent about it.
|
||||
await prisma().measurement.create({
|
||||
data: {
|
||||
userId: USER,
|
||||
type: "RESTING_HEART_RATE",
|
||||
value: 61,
|
||||
unit: "bpm",
|
||||
source: "OURA",
|
||||
measuredAt: new Date(later.getTime() - 10 * 60 * 1000),
|
||||
},
|
||||
});
|
||||
const recovered = await runIntegrationWatchdog({
|
||||
mode: "hourly",
|
||||
now: new Date(later.getTime() + HOUR),
|
||||
});
|
||||
expect(recovered.incidentsClosed).toBe(1);
|
||||
expect(dispatchNotification).not.toHaveBeenCalled();
|
||||
|
||||
// A new incident after the first pass pages as usual.
|
||||
for (let i = 0; i < 3; i++) {
|
||||
await recordSyncFailure({
|
||||
|
||||
Reference in new issue
Block a user