From 6263c7e16f5c1ff395b4e825189ea05c9defcd6c Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Mon, 24 Aug 2026 14:21:26 +0000 Subject: [PATCH] fix: clear resolved_at when reopening a status incident via appended update --- server/internal/services/statusincidents.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/internal/services/statusincidents.go b/server/internal/services/statusincidents.go index 13a636c..e83c054 100644 --- a/server/internal/services/statusincidents.go +++ b/server/internal/services/statusincidents.go @@ -228,6 +228,13 @@ func AppendStatusIncidentUpdate(instanceID, incidentID, status, body, author str set := bson.M{"status": status, "updated_at": upd.At} if status == models.IncidentResolved || status == models.MaintenanceCompleted { set["resolved_at"] = upd.At + } else { + // Reopening via an appended update must clear a previously-set + // resolved_at the same way UpdateStatusIncident does — otherwise a + // resolved incident reopened to "monitoring" keeps a stale resolved_at + // and silently drops off ListStatusIncidentsForPage once started_at + // ages past the since cutoff, because none of its $or clauses match. + set["resolved_at"] = nil } ctx, cancel := spCtx()