Repository navigation
fix(radio): Keep recovery from reporting aborted pending loads - #478
Merged
Merged
Conversation
Recovery reloads call loadAttachedSource without bumping generation, so cancelLoad aborts the still-pending waitUntilReady and the same-generation AbortError was reported as an unexpected PLAY_ERROR. Track attachment epochs so a superseded pending load settles without onError, leave resume to the recovery reload, and keep real media errors visible. Fixes RADIO-27 https://avoidquest.sentry.io/issues/RADIO-27 Changelog: Recovery no longer reports a false playback failure when it cancels a stream that was still connecting. 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 52 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-27-recovery-reload-abort-8c2f-radio.cwav.workers.dev (commit f01438c)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
Recovery's watchdog reload calls
loadAttachedSourcewithout bumping generation. ThatcancelLoad()-aborts a still-pendingwaitUntilReady, and the same-generationAbortError: Load abortedwas reported as an unexpectedPLAY_ERROR(RADIO-27 onradio@0.7.2, Firefox, single-mode Icecast).Fixes RADIO-27
https://avoidquest.sentry.io/issues/RADIO-27
Evidence
scheduleReload→reload→loadAttachedSource→attachment.load→cancelLoadrejects the prior same-generationwaitUntilReadywithAbortError: Load aborted.MediaElementPlaybackSource.load()treated that as terminal because generation was unchanged.7f7ed3b): fix(radio): Switch stations without false playback errors #457 ignores queued media-elementabortevents and scopes intentionalplay()supersession for pause/stop/cleanup/load(). It does not treat recovery's controller abort of a pending same-generation attachment as expected cancellation.recovery reload canceling a pending load does not report AbortErrorfailed becauseonErrorreceivedAbortError/Load aborted.a real media error during a pending load still reports onErrorand the existing recovery / RADIO-23 suites pass (73 tests across playback-source + audio-manager).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 / composability
abort+ intentional play supersession (RADIO-23/24 station-switch path)7f7ed3bplayForIntent(Chromeplay()interrupted by new load)media-element-playback-source.ts/.test.tswaitUntilReadyAbortError reporting (RADIO-27)#475 does not change pending-load cancellation or
onErrorreporting. This PR does not addsupersedeInFlightPlay, does not re-route recoveryresumethroughplayForIntent, and does not duplicate that play-intent fix. The only adjacentplay()change here is: after a superseded pendingload()settles, if recovery is still reloading, leave resume to recovery instead of racing a secondplay(). That is load-generation ownership, not play-intent invalidation.Expected merge: either order works. Text conflicts are likely around
loadAttachedSource(this PR) vs recoveryreload/resumewrappers (#475) and separately added tests in the same describe block.Merge Danger
Door: two-way
Code-only playback ownership change; no migration or deploy.
Blast Radius: playback
Shared media-element recovery for Single, Node, and DJ. Genuine pending-load media errors remain visible; only same-generation recovery cancellations of superseded attachments are settled.
Summary by cubic
Fixes recovery's reload canceling a still-pending load so it no longer reports a false
PLAY_ERROR(RADIO-27). Tracks an attachment epoch so a superseded pending load settles silently and recovery owns resume, while genuine media errors during a pending load still reachonError.Written for commit f01438c. Summary will update on new commits.