Keep Radio Alhara off the retired RadioJar mount

Merged
FC
15d ago
+195-11

Change

Fixes RADIO-22

Root cause (verified): production single-mode PLAY_ERROR events with message Audio stream format is not supported were Chrome mapping MEDIA_ERR_SRC_NOT_SUPPORTED for the retired Radio Alhara RadioJar mount n03.radiojar.com (HTTP 404 today). 12/14 events used that host; event release radio@0.7.2 predates the playback override. Last event 2026-10-26T12:37:37Z was ~12 minutes before #456 landed.

Already on main: #456 (f0c5c33) redirects persisted RadioJar URLs through toPlaybackInput to https://stream.radioalhara.net/ra (and updates presets). This PR does not re-implement that; it adds regressions so the media readiness path Sentry attributed cannot lose the override, and so genuine unsupported-stream failures stay user-visible and reportable (no telemetry suppression).

Overlap: RADIO-1Z is the same RadioJar 404 symptom in node mode on an older release. It shares toPlaybackInput / mediaElementError with single mode. Left for the separate assignee; this PR only locks single-mode coverage and documents the shared code.

Out of scope: AbortErrors, provider failures, and node-mode-only work.

Evidence (red → green)

Without the Alhara override (temporary local removal of the #456 line):

error: Audio stream format is not supported
(fail) single-mode Radio Alhara loads never attach the retired RadioJar mount
(fail) upgrades persisted Radio Alhara URLs to its first-party stream

With the override restored (current main behavior):

(pass) single-mode Radio Alhara loads never attach the retired RadioJar mount
(pass) upgrades persisted Radio Alhara URLs to its first-party stream
(pass) support limits preserve guidance; ordinary media failures still reach Sentry

Live probes (not fixtures): RadioJar mount → 404; first-party Alhara GET → 200 audio/mpeg with CORS *.

Validation

  • bun test apps/radio/src/lib/audio/playback/media-element-playback-source.test.ts apps/radio/src/lib/audio/playback/playback-input.test.ts apps/radio/src/lib/playback-action-errors.test.ts — 41 pass
  • bun run check — pass
  • bun run typecheck — pass
  • Not run: full apps/radio suite, browser E2E, deploy
  • No Sentry status changes, no merge, no deploy

Remaining limitations

  • 2/14 historical events used other hosts (zeppelin.streampunk.cc, streams.radiomast.io); those still surface as unexpected PLAY_ERROR when the media element rejects a source (diagnostics preserved). BlackOut/NTS already have separate overrides.
  • stream_host telemetry uses the stored radio URL, so legacy RadioJar hosts can still appear in tags even when playback uses the rewritten source.
  • Production package version on main is still 0.7.2; confirm deploy carries #456 if any residual RadioJar reports appear after this lands.
Open in Web Open in Cursor 

Summary by cubic

Keeps Radio Alhara away from the retired n03.radiojar.com mount to prevent the PLAY_ERROR events RADIO-22 tracked. Playback already rewrites that mount through toPlaybackInput; this PR locks in regression tests for the media path, error reporting, and single-mode AudioManager remounting.

The override matches by origin and path, so query/hash variants and trailing slashes rewrite to the first-party stream, while lookalike hosts, embedded paths, and distinct origins (different ports or protocol) stay untouched. Unsupported-format errors get distinct user guidance from unreachable-stream errors while still reaching Sentry.

Summary by CodeRabbit

  • Tests
    • Added coverage for single-mode playback using the current Radio Alhara stream when the retired stream URL fails.
    • Added coverage for unsupported-stream errors, including station URL guidance and error reporting.