Repository navigation
fix(player): keep the plan's subtitle after a credential reload - #627
Merged
Merged
Conversation
Every access-token rotation on a header-authenticated original file reloads the same Protocol V3 plan in place so Aether picks up the new Authorization header. AetherEngine.load clears the engine's subtitle selection, and the plan's pending subtitle pick was already spent on the plan's first load. The reload therefore came back with the picker still showing the subtitle checked and nothing selected in the engine: cues stopped mid-playback with no error, and a resume that hit a rotation a few seconds in never rendered at all. The credential reload now re-arms the plan's subtitle just before the engine load, after the audio probe's await. Only a selection the plan owns is re-armed; a local pick, a sidecar this session created, and a live AI track keep their own restore paths.
|
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 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
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. Comment |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
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.
Problem
Related issue: #283, #589
Validation tasks: changes #337 C10
A selected embedded subtitle sometimes stopped mid-playback on direct play, with no error, until another track was picked. A resume that hit an access-token rotation a few seconds in never showed subtitles at all. The cause is the credential reload that runs on every token rotation for a header-authenticated original file: it dropped the plan's subtitle. The reload now keeps it.
Approach
Every token rotation reloads the same Protocol V3 plan in place so Aether picks up the new
Authorizationheader.AetherEngine.loadclears the engine's subtitle selection, and the plan's pending subtitle pick was already spent on the first load, so the reload came back with the picker still showing the track checked and nothing selected in the engine.The credential reload now re-arms the plan's subtitle just before the engine load, after the audio probe. Only a selection the plan owns is re-armed; a local pick, a sidecar this session created and a live AI track keep their own restore paths.
Overlap: #611 (open) stops most direct-play reloads on rotation by refreshing credentials per range request. Audio-only media keeps the reload path there, so this fix still applies after #611; if #611 merges first, the conflict is limited to the reload function.
Validation
scripts/ci/check-no-api-v1.sh: pass.main(6242652): the full iOS unit suite ran 2,691 tests. The only failures areArtworkURLTests.testDeliveryCapabilityOnIOSUsesV2RouteAndResetsandImageSizeCapabilityTests.testResetClearsCapability, which fail the same way onmain. tvOSbuild-for-testingand the macOS build succeed.Simulator screenshots (iOS 26.5, tvOS 26.5):
Risks
None identified.
Checklist
AI Disclosure
mainat medium effort, checking behaviour, platform guards (iOS, tvOS, macOS), tests and commit hygiene. No findings. The reviewer noted the tests call the re-arm directly rather than through the load path, and checked the load path by reading it.Note
Restore the plan's subtitle after a credential reload in
PlayerViewModelreselectsPlanSubtitle: truetoloadAether, which re-arms the protocol V3 plan's subtitle after preparation and beforebeginLoad.PlayerViewModel.armProtocolV3SubtitleIntentForSamePlanReloadto rebuild the pending embedded/sidecar/server-rendered subtitle intent for the current plan.PlayerViewModel.protocolV3SubtitleSelectionIsPlanOwnedto decide what counts as plan-owned: it rejects local selections, live AI tracks, and sidecars absent from the plan; an off plan only matches a nil selection.Macroscope summarized 09a3c6c.