Skip to content

Recover ListenBrainz lookups when now-playing stalls - #188

Merged
variablenix merged 1 commit into
mainfrom
fix/listenbrainz-resilience
Nov 20, 2026
Merged

variablenix merged 1 commit into
mainfrom
fix/listenbrainz-resilience

Conversation

@variablenix

@variablenix variablenix commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Cause

A stalled optional now-playing request consumed the entire lookup deadline, preventing the independent recent-listens endpoint from answering. This was reproduced outside GoBot while the recent-listens endpoint remained responsive.

Fix

  • Limit the optional current-track attempt to five seconds or one third of the configured overall timeout.
  • Try recent listens when current status fails, and explicitly label current status unavailable rather than misrepresent a recent track as live.
  • Reserve time for one transient-error retry, preserving the overall deadline, shared one-request-per-second limiter, provider reset windows and Retry-After instructions.
  • Distinguish timeouts from empty recent history, include a safe profile link during outages, and log only classified reasons without usernames, URLs, bodies or raw transport errors.
  • Preserve existing settings, scoped defaults, terminal-safe formatting and bounded output. Recognize valid recent-track fallbacks in live smoke assertions.

Passed validation

  • Full race suite including offline Chrome fixtures; go vet; staticcheck; build
  • govulncheck: no vulnerabilities found; staged Gitleaks scan: no leaks found
  • Synthetic stalled headers/body, transient HTTP/network/body-read errors, retry spacing, provider cooldown, complete outage, cancellation and log-privacy regressions
  • Three consecutive read-only public command-handler smoke tests passed locally before the upstream failures recurred, without IRC traffic or credentials
  • Required GitHub checks and focused Linux deployment-host regressions

Deployment and remaining upstream limitation

Merged and deployed revision ce49ce1, rebuilt with Go 1.26.11, and restarted successfully. Running executable metadata matches the unmodified revision; both networks and all four configured channel memberships are healthy. Production configuration, environment and certificate checksums are unchanged; stored data was not manually modified.

Live provider verification remains blocked by upstream failures. Repeated deployment-host checks returned HTTP 502 or timed out, including independent HTTP/1.1 and HTTP/2 requests and other public users. The code fix cannot recover fresh data when both upstream endpoints are unavailable. These live checks failed and are not represented as passing tests. During those failures, the command retains its deadline, reports the API failure honestly and provides a profile link rather than treating missing data as empty history.

@variablenix
variablenix merged commit ce49ce1 into main Nov 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant