mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
23695681ac
Patrol findings previously reached operators only through the Relay mobile push path. Anyone relying on the email, webhook, or Apprise destinations they already configured for alerts got no proactive signal when Patrol detected a problem and had to open /patrol to learn about it. This is the delivery half of #1369. Each newly stored warning or critical finding now also flows through a FindingNotifyCallback wired in the router, which projects the finding into the alert shape the notification manager delivers. The callback fires only on the genuinely-new path in recordFindingWithInvestigation, so a finding notifies at most once per lifetime regardless of how many later runs re-detect it, and SendAlert's own per-ID cooldown backstops that. Demo mode never notifies. Gating lives in AIConfig via patrol_finding_notifications_enabled (default on, matching the long-standing default for mobile push) and patrol_finding_notify_min_severity (warning or critical, default warning). The enabled flag persists without omitempty so an explicit opt-out survives reload while pre-existing configs inherit the default. The settings surface for these fields follows in a separate commit once the AI settings handler is free.