Repository navigation
fix(radio): Keep recovery reloads from raising false play errors - #475
Merged
Merged
Conversation
Recovery reattaches media through loadAttachedSource without load(), so an in-flight play() could still reject with Chrome's AbortError when the element loaded again. Supersede that play intent without clearing resume, and route recovery resume through the same ownership check. Fixes RADIO-24 https://avoidquest.sentry.io/issues/RADIO-24 Changelog: Recovery no longer reports a false playback failure when it reloads a stream that was already trying to play. Co-authored-by: Francesco Castrovilli <fcastrovilli@users.noreply.github.com>
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://cursor-radio-24-play-load-race-b786-radio.cwav.workers.dev (commit 7a70776)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chrome rejects an in-flight
play()withAbortError: The play() request was interrupted by a new load requestwhen media is reattached.#457already scoped pause/stop/cleanup/load()interruptions to playback intent, but recovery still reattached throughloadAttachedSourcewithout retiring the in-flight play. That left the samePLAY_ERRORreachable on current main.Fixes RADIO-24
https://avoidquest.sentry.io/issues/RADIO-24
Evidence
loadAttachedSource(notload()), so they skippedcancelPendingPlaybackIntent. An earlierplay()stayed current, then Chrome aborted it when recovery calledaudio.load(), andplayForIntentrethrew that AbortError into Single-modePLAY_ERRORreporting.7f7ed3b/ fix(radio): Switch stations without false playback errors #457): station switch, pause, stop, cleanup, and explicitload()no longer raise false play errors. Production events through 2026-11-04 are still taggedradio@0.7.2, which predates that deployable fix for the intentional source-change path.error.a recovery reload does not reject an in-flight play for the same resume intentfailed with the Chrome AbortError before the source change.bun run check,bun run typecheck,bun run --filter @avoid.quest/radio build, and focusedbun testonmedia-element-playback-source.test.ts+audio-manager.test.tspass.Overlap
load()play supersession remain there; this PR does not revisit attachment abort listeners.AbortError: Load abortedfromwaitUntilReady). This PR only retires play promises around recovery reattach and does not change load-cancellation reporting.Merge Danger
Door: two-way
Code-only playback ownership change; no migration or deploy.
Blast Radius: playback
Shared media-element recovery resume for Single, Node, and DJ. Genuine active-intent play failures remain visible; only superseded in-flight plays are settled.
Summary by cubic
Recovery reloads no longer raise false playback errors when a stream was already trying to play. Recovery reattaches media through
loadAttachedSourcewithoutload(), so an in-flightplay()stayed current and Chrome rejected it with anAbortErroronce the element reloaded. Recovery now supersedes that play intent before reattaching and routes resume through the same ownership check that already covers pause, stop, cleanup, and explicitload(). Genuine play failures likeNotAllowedErrorandNotSupportedErrorstill report.Written for commit 7a70776. Summary will update on new commits.