Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix(api): return 404 from undismiss endpoint for invalid finding IDs (#1300)

rcourtman10a4e994b6e5
diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.go
index 602da2a1ab..ab503cfba5 100644
--- a/internal/api/ai_handlers.go
+++ b/internal/api/ai_handlers.go
@@ -3905,10 +3905,17 @@ func (h *AISettingsHandler) HandleUndismissFinding(w http.ResponseWriter, r *htt
}
findings := patrol.GetFindings()
- findings.Undismiss(req.FindingID)
+ ok := findings.Undismiss(req.FindingID)
if store := h.GetUnifiedStore(); store != nil {
- store.Undismiss(req.FindingID)
+ if store.Undismiss(req.FindingID) {
+ ok = true
+ }
+ }
+
+ if !ok {
+ http.Error(w, "Finding not found or not dismissed", http.StatusNotFound)
+ return
}
log.Info().