From be4ba0bbf5674d8236401b2efea539216f22594e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 7 Nov 2026 21:40:16 +0000 Subject: [PATCH 1/2] test(radio): Cover Node Alhara RadioJar remount for RADIO-1Z Prove the shared #456 toPlaybackInput rewrite already remounts persisted RadioJar Alhara URLs on the Node AudioManager play path, and that a real unsupported-stream failure still surfaces as a Node PLAY_ERROR. Fixes RADIO-1Z Changelog: skip Co-authored-by: Francesco Castrovilli --- .../lib/audio/manager/audio-manager.test.ts | 29 +++++++++++++++++ apps/radio/src/lib/node-playback.test.ts | 31 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/apps/radio/src/lib/audio/manager/audio-manager.test.ts b/apps/radio/src/lib/audio/manager/audio-manager.test.ts index 1efa4f996..9e0d0fa1a 100644 --- a/apps/radio/src/lib/audio/manager/audio-manager.test.ts +++ b/apps/radio/src/lib/audio/manager/audio-manager.test.ts @@ -393,6 +393,35 @@ describe("AudioManager", () => { } }); + // RADIO-1Z: Node mode loads through AudioManager.playSound → toPlaybackInput. + // Persisted RadioJar Alhara URLs must remount before readiness, or Chrome + // reports MEDIA_ERR_SRC_NOT_SUPPORTED and the lane maps it to PLAY_ERROR. + test("Node playSound remounts a persisted Radio Alhara RadioJar URL", async () => { + const harness = createMediaPlaybackHarness(); + try { + const { manager, browser, effects } = harness; + effects.connectGraph = mock(async () => true); + const soundId = manager.createSound( + { + name: "Radio Alhara", + streamUrl: "https://n03.radiojar.com/78cxy6wkxtzuv", + }, + "node:n:alhara", + "native", + "station" + ); + const starting = manager.playSound(soundId); + await flushMicrotasks(); + expect(browser.audio().loadSources).toEqual([ + "https://stream.radioalhara.net/ra", + ]); + browser.audio().emit("canplay"); + await starting; + } finally { + harness.restore(); + } + }); + test("unsupported Safari live radio leaves the Node sound stopped", async () => { const harness = createMediaPlaybackHarness(); try { diff --git a/apps/radio/src/lib/node-playback.test.ts b/apps/radio/src/lib/node-playback.test.ts index 8179d11af..61cb150cf 100644 --- a/apps/radio/src/lib/node-playback.test.ts +++ b/apps/radio/src/lib/node-playback.test.ts @@ -1574,6 +1574,37 @@ describe("Node Playback starts", () => { ); }); + // RADIO-1Z: a real unsupported-stream failure must stay visible on the lane + // and still report as PLAY_ERROR. Remapping dead hosts is separate; do not + // swallow format failures in Node lifecycle ownership. + test("reports an unsupported stream format as a Node PLAY_ERROR", async () => { + insertNodeSession(patch([station("alhara")])); + const harness = createHarness(); + harness.context.audio.playSound = mock(() => + Promise.reject(new Error("Audio stream format is not supported")) + ); + await harness.playback.activate(); + + await harness.playback.setPlaying("alhara", true); + await harness.playback.whenSettled(); + + expect(getPlaybackChannelRuntime(channelOf("alhara")).error).toMatchObject({ + code: "PLAY_ERROR", + message: + "The stream could not be reached. Check the station URL and try again.", + }); + expect(harness.context.reportError).toHaveBeenCalledWith( + expect.objectContaining({ + cause: expect.objectContaining({ + message: "Audio stream format is not supported", + }), + channelId: channelOf("alhara"), + code: "PLAY_ERROR", + mode: "node", + }) + ); + }); + test("reconciles main output settings when playback starts a lane", async () => { insertNodeSession(patch([station("a")])); const patches: unknown[] = []; From 9a40b5829a2a1f9d1e2a5b15ed21c85d3c7e952f Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli Date: Sun, 8 Nov 2026 00:28:05 +0100 Subject: [PATCH 2/2] test(radio): Align Node unsupported-format guidance --- apps/radio/src/lib/node-playback.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/radio/src/lib/node-playback.test.ts b/apps/radio/src/lib/node-playback.test.ts index c5daf0b0f..ae7756008 100644 --- a/apps/radio/src/lib/node-playback.test.ts +++ b/apps/radio/src/lib/node-playback.test.ts @@ -1591,7 +1591,7 @@ describe("Node Playback starts", () => { expect(getPlaybackChannelRuntime(channelOf("alhara")).error).toMatchObject({ code: "PLAY_ERROR", message: - "The stream could not be reached. Check the station URL and try again.", + "This audio format is not supported. Check the station stream or try another source.", }); expect(harness.context.reportError).toHaveBeenCalledWith( expect.objectContaining({