diff --git a/internal/channels/health.go b/internal/channels/health.go index 0ad1d97c..333eaba7 100644 --- a/internal/channels/health.go +++ b/internal/channels/health.go @@ -304,6 +304,7 @@ func mergeChannelHealth(previous, snapshot ChannelHealth) ChannelHealth { } snapshot.ConsecutiveFailures = 0 snapshot.FirstFailedAt = time.Time{} + snapshot.FailureKind = "" if snapshot.LastFailedAt.IsZero() { snapshot.LastFailedAt = previous.LastFailedAt } diff --git a/internal/channels/health_test.go b/internal/channels/health_test.go index 52bd5646..c11e6dea 100644 --- a/internal/channels/health_test.go +++ b/internal/channels/health_test.go @@ -504,6 +504,9 @@ func TestMergeChannelHealthTracksFailureTimelineAndRecovery(t *testing.T) { recovered.CheckedAt = recoveredAt recovered = mergeChannelHealth(second, recovered) + if recovered.FailureKind != "" { + t.Fatalf("expected failure kind to clear after recovery, got %q", recovered.FailureKind) + } if recovered.ConsecutiveFailures != 0 { t.Fatalf("expected consecutive failures reset, got %d", recovered.ConsecutiveFailures) }