Skip to content

fix(music): a busy server keeps its last catalogue, so /music is not emptied (0.80.7) - #434

Merged
ralyodio merged 1 commit into
mainfrom
worktree-music-hub-stale-fallback
Nov 14, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-music-hub-stale-fallback

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

nixamp.com/music went blank on 2026-11-14 around 12:40 UTC: /api/v1/music returned {"holders":[],"genres":[],"stations":[]}.

Cause: the 0.80.6 deploy restarted nixamp.com twice (12:31 and 12:37), and server2, the only server with the AI label, was at load 58 (ffprobe plus llama-server). MusicHub reads each server's /api/v1/label and guide with a 6 s timeout and drops a server that misses it, so the catalogue came back empty and kept doing so until server2 answered in time. It recovered by itself around 12:49.

Fix: MusicHub now keeps each server's last good label and guide for up to 30 minutes (STALE_MS) and uses them when a fresh read fails. A server that has been gone longer still drops out.

Test: bun test test/music-hub.test.ts (8 pass, new case covers a server going down, being kept, then aging out); tsc --noEmit clean.

🤖 Generated with Claude Code

… no longer empties nixamp.com/music (0.80.7)

The hub reads each server's /api/v1/label and guide with a 6 s timeout and
dropped a server that missed it. server2 (the only AI label) at load 58 after
the 0.80.6 rollout missed it, and /music showed nothing. Each server now keeps
its last good answers for up to 30 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

1 finding(s) in the 3 file(s) this pull request changes.

HIGH: 1

Severity Rule Location
HIGH js-ssrf-outbound-request src/music-hub.ts:317
55 pre-existing finding(s) elsewhere in the repository — **HIGH**: 16 | **MEDIUM**: 15 | **LOW**: 24

Not introduced by this pull request.

Severity Rule Location
HIGH secret-database-url .github/workflows/translation.yml:31
HIGH secret-generic-credential src/hls.ts:81
HIGH js-host-header-trust src/server.ts:3133
HIGH js-host-header-trust src/server.ts:3147
HIGH js-host-header-trust src/server.ts:3164
HIGH js-host-header-trust src/server.ts:3173
HIGH js-host-header-trust src/server.ts:3178
HIGH js-host-header-trust src/server.ts:3281
HIGH js-host-header-trust src/server.ts:3347
HIGH js-host-header-trust src/server.ts:3434
HIGH js-host-header-trust src/server.ts:3462
HIGH js-host-header-trust src/server.ts:3632
HIGH js-host-header-trust src/server.ts:3648
HIGH js-ssrf-outbound-request web/src/app.ts:115
HIGH js-ssrf-outbound-request web/src/app.ts:163
HIGH js-ssrf-outbound-request web/src/app.ts:167
MEDIUM js-unescaped-html-sink backtoschool/src/main.ts:95
MEDIUM js-unescaped-html-sink backtoschool/src/main.ts:241
MEDIUM js-unescaped-html-sink backtoschool/src/main.ts:257
MEDIUM js-unescaped-html-sink backtoschool/src/main.ts:281

…and 35 more; the full set is in the SARIF artifact.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit eee590e into main Nov 14, 2026
6 checks passed
@ralyodio
ralyodio deleted the worktree-music-hub-stale-fallback branch November 14, 2026 12:52
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