Skip to content

test(radio): Lock single-mode load abort against false PLAY_ERROR - #476

Merged
fcastrovilli merged 1 commit into
mainfrom
cursor/radio-23-load-abort-regression-003f
Nov 7, 2026
Merged

fcastrovilli merged 1 commit into
mainfrom
cursor/radio-23-load-abort-regression-003f

Conversation

@fcastrovilli

@fcastrovilli fcastrovilli commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Change

RADIO-23 is already fixed on main by #457 (7f7ed3b). This PR adds regression proof for the single-mode lifecycle and does not change production playback code.

Verified root cause (radio@0.7.1)

Production reported AbortError: Load aborted as handled PLAY_ERROR (mode: single, external streams, retry_phase: none, no stack). Two events (2026-10-19 Chrome/macOS; 2026-10-21 Samsung Internet/Android).

In MediaElementAttachment.waitUntilReady, listening to the media element abort event treated a queued abort from the previous load() as failure of the current attachment. That rejection bubbled as DOMException("Load aborted", "AbortError") and was reported as unexpected PLAY_ERROR.

#457 stopped listening to media abort and cancels only via the attachment AbortController. Media error and the readiness timeout still fail closed.

Intentional cancellation was a hypothesis; the established defect is the unscoped media abort during load/replacement lifecycle transitions.

This PR

  • Adds an AudioManager regression: playing Single stream replacement ignores a queued media abort and stays healthy (no error state).
  • Comments the existing media-element queued-abort regression for the RADIO-23 shape.
  • Companion assertions remain: a bare media abort does not hide a subsequent load error or timeout (genuine failures stay reported).

Out of scope (other agents): RADIO-24 obsolete play() rejection; RADIO-27 recovery cancelLoad / pending-load cancellation.

Fixes RADIO-23
https://avoidquest.sentry.io/issues/RADIO-23

Validation

  • TDD proof: with the attachment fix temporarily reverted, the new AudioManager test fails with AbortError: Load aborted; with current main, it passes.
  • bun run check — pass
  • bun run typecheck — pass
  • bun test apps/radio/src/lib/audio/manager/audio-manager.test.ts apps/radio/src/lib/audio/playback/media-element-playback-source.test.ts — 72 pass / 0 fail
  • Not run: full @avoid.quest/radio suite / build (test-only change; no production code)
  • Not verified: physical-device Samsung Internet replay; production deploy; Sentry status (left unchanged)

Base SHA: 7f7ed3bf52672df71a5514591af0b3a866708d0b

Changelog: skip

Open in Web Open in Cursor 

Summary by cubic

Adds regression tests for RADIO-23, proving a playing single-mode stream replacement ignores a queued media abort from the previous load() instead of reporting AbortError: Load aborted as PLAY_ERROR. No production code changes; the fix already landed on main in #457.

  • Covers both the AudioManager lifecycle and the MediaElementPlaybackSource queued-abort shape.
  • Existing assertions remain in place so a bare abort does not mask genuine load errors or timeouts.

Written for commit a0f6e4a. Summary will update on new commits.

View guided diff Turn on auto-fix

Prove a playing Single stream replacement ignores a queued media abort so
AbortError "Load aborted" is not treated as a current-request failure.
Comment the existing media-element regression for the same Sentry shape.

No production code change: main already scopes cancellation to the
attachment AbortController (#457).

Fixes RADIO-23

Changelog: skip
Co-authored-by: Francesco Castrovilli <fcastrovilli@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b70b339-3e4f-44c2-a52c-cb7edfbab357
Commits

Reviewing files that changed from the base of the PR and between 7f7ed3b and a0f6e4a.

Files selected for processing: 2

  • apps/radio/src/lib/audio/manager/audio-manager.test.ts
  • apps/radio/src/lib/audio/playback/media-element-playback-source.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T21:42:53.259868Z a0f6e4a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://cursor-radio-23-load-abort-regression-003f-radio.cwav.workers.dev (commit a0f6e4a)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://7820d0c4-radio.cwav.workers.dev a0f6e4a 2026-11-07T21:43:17.945Z Visit the dashboard ↗

@fcastrovilli
fcastrovilli merged commit 4fd361e into main Nov 7, 2026
4 checks passed
@fcastrovilli
fcastrovilli deleted the cursor/radio-23-load-abort-regression-003f branch November 7, 2026 23:32
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.

2 participants