diff --git a/hub/CHANGELOG.md b/hub/CHANGELOG.md index b87820c..82c029c 100644 --- a/hub/CHANGELOG.md +++ b/hub/CHANGELOG.md @@ -1,5 +1,14 @@ # Felhom Hub — Changelog +## v0.73.1 — allowlist `disk_health_degraded` (controller v0.169.0 disk-health) (2026-07-24) + +Adds `disk_health_degraded` to `allowedEventTypes` so the controller's per-disk SMART degradation +notification (v0.169.0) is ingested and delivered instead of 400-rejected. Like `offbox_enlarge_blocked`, +there is deliberately **no `customerMessages` entry** — the controller sends a dynamic Hungarian message +(disk label + the triggering attribute names), which the templates.go fallback preserves; a static entry +would discard the specifics. Test `TestHandleEvent_DiskHealthDegradedAccepted` (red-proof: drop the +allowlist line → 400). + ## v0.73.0 — `offsite_stale` no longer cries wolf on a newborn tier (ISO-train v1.25.0 Part 7) (2026-07-23) Origin (operator, 2026-07-23 12:01 CEST): demo-hp's offsite was repaired and escrowed at 10:01Z and diff --git a/hub/internal/api/event_test.go b/hub/internal/api/event_test.go index ff5e869..e38b5c3 100644 --- a/hub/internal/api/event_test.go +++ b/hub/internal/api/event_test.go @@ -97,6 +97,25 @@ func TestHandleEvent_OffboxEnlargeBlockedAccepted(t *testing.T) { } } +// Scenario (controller v0.169.0): disk_health_degraded is an accepted controller-pushed type — the +// disk-health degradation email's delivery chain starts at hub ingestion. Red-proof: removing the +// allowlist entry makes this 400 (which would silently drop the customer's disk-degradation email). +func TestHandleEvent_DiskHealthDegradedAccepted(t *testing.T) { + h, st := newEventTestHandler(t) + + rr := do(h, http.MethodPost, "/event", "ckey", eventBody("warning", "disk_health_degraded")) + if rr.Code != http.StatusOK { + t.Fatalf("status = %d, want 200 (disk_health_degraded must be allowlisted); body=%s", rr.Code, rr.Body.String()) + } + evs, err := st.GetRecentEvents("c1", 10) + if err != nil { + t.Fatalf("GetRecentEvents: %v", err) + } + if len(evs) != 1 || evs[0].EventType != "disk_health_degraded" { + t.Errorf("stored = %+v, want exactly one disk_health_degraded event", evs) + } +} + // Auth: no bearer at all is a 401 and stores nothing. func TestHandleEvent_Unauthorized(t *testing.T) { h, st := newEventTestHandler(t) diff --git a/hub/internal/api/handler.go b/hub/internal/api/handler.go index 598af5e..33ba7ff 100644 --- a/hub/internal/api/handler.go +++ b/hub/internal/api/handler.go @@ -1572,6 +1572,11 @@ var allowedEventTypes = map[string]bool{ "storage_reconnected": true, "disk_warning": true, "disk_critical": true, + // controller v0.169.0 — per-disk SMART degradation (Rendben→Figyelmeztetés/Hiba). The controller + // sends a dynamic Hungarian message (disk label + the triggering attribute names), so — like + // offbox_enlarge_blocked — there is deliberately NO customerMessages entry (which would discard the + // specifics via the templates.go fallback priority). + "disk_health_degraded": true, "health_degraded": true, "health_critical": true, "health_recovered": true,