From d359c3c39f4df0643f5fc858f145f7dfa1a6ba02 Mon Sep 17 00:00:00 2001 From: Ravi Pina Date: Tue, 16 Jun 2026 10:12:13 -0700 Subject: [PATCH] fix: hide superseded failure in show api status The status display printed Last Failure whenever it was non-zero, even when a newer success had already cleared the failure on disk. Gate the line on the same "currently failing" check (failure newer than success) the health status already uses, so recovered APIs stop showing stale failures. --- cmd/show_api_status.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/show_api_status.go b/cmd/show_api_status.go index 32696db..96a15bc 100644 --- a/cmd/show_api_status.go +++ b/cmd/show_api_status.go @@ -101,7 +101,9 @@ func runShowAPIStatus(cmd *cobra.Command, args []string) error { fmt.Printf(" Last Success: %s (%s ago)\n", lastSuccess.Format("2006-01-02 15:04:05"), formatDuration(time.Since(lastSuccess))) } - if !lastFailure.IsZero() { + // Only surface a failure that the latest success hasn't already superseded. + // An older failure is stale history; a success newer than it means recovery. + if lastFailure.After(lastSuccess) { fmt.Printf(" Last Failure: %s (%s ago)\n", lastFailure.Format("2006-01-02 15:04:05"), formatDuration(time.Since(lastFailure))) }