Close an alert: dealt with or accepted, hidden until it gets worse

Close... on the Alerts page hides an alert with no end, with an optional reason
that is also written on its incident. It opens again only if it gets more
serious than when it was closed (said once) or the problem has been gone for
half an hour; Open again brings it back at once.

Built on the snooze table (kind, severity and note columns), so everything that
holds back snoozed alerts holds back closed ones. Audit log, change log and
/api/v1 alerts carry it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-25 20:55:39 +01:00
1 parent 4ff0b44943
commit a94899865e
24 files changed
+7982 -24

No files matched your search

+3 -2
View File
@@ -684,12 +684,13 @@ export async function collectAlerts(): Promise<AlertsReport> {
if (flapping.size > 0) for (const a of alerts) if (flapping.has(keyOfAlertId(a.id, a.category))) a.flapping = true;
// Those somebody has snoozed are held back like those under maintenance, with when they come back.
const snoozes = await loadSnoozes().catch(() => new Map<string, { until: string; snoozedBy: string }>());
const snoozes = await loadSnoozes().catch(() => new Map<string, { until: string; snoozedBy: string; snoozedAt: string; closed: boolean; note: string | null }>());
if (snoozes.size > 0) {
for (const a of alerts) {
const sn = snoozes.get(a.id);
if (sn) {
a.snoozed = { until: sn.until, by: sn.snoozedBy };
if (sn.closed) a.closed = { by: sn.snoozedBy, at: sn.snoozedAt, note: sn.note };
else a.snoozed = { until: sn.until, by: sn.snoozedBy };
a.silenced = true;
}
}