fix: clear resolved_at when reopening a status incident via appended update

This commit is contained in:
2026-08-24 14:21:26 +00:00
parent 161835802d
commit 6263c7e16f
@@ -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()