diff --git a/src/lib/db.ts b/src/lib/db.ts index 5a30722..f935863 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -126,14 +126,14 @@ export function upsertAlerts(candidates: AlertCandidate[]): number { if (isSuppressed) continue; - // Re-open if previously closed (manually or resolved) and not suppressed + // Re-open if previously closed (manually or resolved) and not suppressed. + // Preserve firstSeen and comments — this is the same incident continuing, + // not a brand new one. if (existing.status === "closed") { existing.status = "open"; existing.closeReason = null; existing.closedAt = null; existing.suppressedUntil = null; - existing.firstSeen = nowISO; // treat as a new occurrence - existing.comments = []; } // Refresh content and lastSeen