clusev/app/Models
boban 6dbe2303a4 fix(ui): sidebar alert/threat badges update at once, not up to 60s late
The Alarme + Threats nav badges were cached for 60s and the cache was only
ever left to expire, so when an alert fired (or a fake-login was recorded)
the sidebar count lagged the page content by up to a minute — the content
showed the new state, the badge did not until a refresh.

Centralise each count on its model (AlertIncident::firingCount /
AuditEvent::threatLoginCount24h, still cached) and BUST that cache the
instant the state changes: AlertEvaluator on every fire/resolve,
HoneypotController on each recorded fake login. The badge now matches the
content on the very next render (navigate or refresh) while keeping the
per-render query off the hot path.

(The alert e-mail itself was already fixed by the earlier Queue::before
change; it just needed the long-lived queue worker restarted to pick up
the new code — verified the worker now sends via SMTP, not the log mailer.)

750 tests (new cache-bust coverage).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 20:22:51 +02:00
..
AlertIncident.php fix(ui): sidebar alert/threat badges update at once, not up to 60s late 2026-07-06 20:22:51 +02:00
AlertRule.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
AuditEvent.php fix(ui): sidebar alert/threat badges update at once, not up to 60s late 2026-07-06 20:22:51 +02:00
BannedIp.php feat(auth): BannedIp model + migration 2026-06-20 17:26:28 +02:00
CertEndpoint.php feat(security): TLS certificate expiry monitoring (feature 7/8) 2026-07-05 20:57:53 +02:00
HealthCheck.php feat(uptime): HTTP/TCP health checks + status board (feature 8/8) 2026-07-05 21:04:14 +02:00
HostCredential.php fix(docker): admin-gate the host target + honour a "0" key passphrase (Codex review) 2026-07-05 23:43:18 +02:00
MetricSample.php feat(metrics): persistent resource-history graph on the Server-Details page 2026-06-25 01:31:27 +02:00
Runbook.php feat(commands): ad-hoc fleet commands + runbooks (feature 4/8) 2026-07-05 20:38:09 +02:00
Server.php feat(fleet): server groups — organise the fleet + filter (feature 1/8) 2026-07-05 19:36:17 +02:00
ServerGroup.php feat(fleet): server groups — organise the fleet + filter (feature 1/8) 2026-07-05 19:36:17 +02:00
Setting.php fix: alert mail on queue, SMTP reset, cert/uptime auto-probe, pill heights, XSS 2026-07-06 19:46:46 +02:00
SshCredential.php chore(audit): full code sweep — fix open-redirect, drop dead code, clean docs 2026-06-13 12:54:26 +02:00
TerminalSession.php security: harden proxy trust + model mass-assignment + terminal-token log hygiene 2026-06-26 07:16:10 +02:00
User.php feat(rbac): role enum + column + gates foundation (admin>operator>viewer) 2026-07-05 00:42:16 +02:00
WebauthnCredential.php fix(webauthn): hash-indexed credential ids + reset keys on 2FA disable 2026-06-14 18:40:24 +02:00
WgTrafficSample.php feat(wg): wg_traffic_samples table + model 2026-06-20 23:59:11 +02:00