hub v0.24.0: dispatcher routes critical severity (+ nil-prefs crash guard)
ProcessEvent routed only warning/error; a critical-severity event was silently dropped. Now routes warning/error/critical, logs unrecognized severities, and guards a nil GetNotificationPrefs (which would panic/crash the hub). host_disk_critical emits its natural critical severity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxLA1mZurFq9kt8hneFeCs
This commit is contained in:
@@ -117,8 +117,8 @@ func TestHostDiskChecker_Severity(t *testing.T) {
|
||||
dc.Check()
|
||||
saveDiskReport(t, st, 97)
|
||||
dc.Check()
|
||||
if len(sev) != 2 || sev[0] != "warning" || sev[1] != "error" {
|
||||
t.Fatalf("severities = %v, want [warning error] (critical band must be 'error' so the dispatcher routes it)", sev)
|
||||
if len(sev) != 2 || sev[0] != "warning" || sev[1] != "critical" {
|
||||
t.Fatalf("severities = %v, want [warning critical] (hub v0.24.0 routes the natural critical severity)", sev)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user