Repository navigation
fix(player): limit expired-link refetch to restored playback - #876
Open
CaptainMusX wants to merge 1 commit into
Open
CaptainMusX wants to merge 1 commit into
CaptainMusX wants to merge 1 commit into
Conversation
Follow-up to the two resume-refetch notes silentbil left on ProdigyV21#817 before it merged (2026-11-02). The fresh source-list refetch fired for any transient startup error on an automatically picked source, so a dead source on a fresh play paid for a full reloadStreams(forceRefresh = true) first, and PARSING_CONTAINER_* errors triggered a refetch that cannot help. It also set startupSameSourceRefreshAttempted before the existing heavy-timeout re-resolve, silently disabling that cheaper path. Gate the refetch on resumed/restored playback (startPositionMs, savedPosition, or a recentSource match for the current title/episode) and on timeout / IO_UNSPECIFIED / IO_NETWORK_CONNECTION_FAILED / IO_BAD_HTTP_STATUS; container parse errors now fall through. Split freshRefetchAttempted and sameSourceRefreshAttempted into separate budgets and report both in startup telemetry. Adds StartupSourceRecoveryTest (4 tests, all passing on sideloadDebug).
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.
背景
#817 已于 2026-11-02 合并。合并前约 2 分钟,silentbil 在复测评论里对
PlayerScreen.kt的 resume refetch 提了两条备注,当时没有代码回应:reloadStreams(forceRefresh = true)再 failover,带来明显延迟;PARSING_CONTAINER_*错误也会触发,但同一文件换新链接并无帮助。建议限定为 resume/restore + network/HTTP 错误码。startupSameSourceRefreshAttempted在已有的 heavy-timeout 重解析之前就置位,导致那条更廉价的路径不再执行。本 PR 只收尾这两条,不含其他改动。
改动
StartupSourceRecovery:把「拉新源列表」与「同源重解析」拆成两个独立预算(freshRefetchAttempted/sameSourceRefreshAttempted),启动时reset()。tryFreshRefetch()同时要求:networkOrHttpFailure= 超时或IO_UNSPECIFIED/IO_NETWORK_CONNECTION_FAILED/IO_BAD_HTTP_STATUS(容器解析错误不再触发);resumeOrRestored=startPositionMs > 0、savedPosition > 0,或recentSource与当前标题/剧集匹配(appliesTo+findRecentSourceMatch)。PlayerScreen接入新类;启动遥测分别上报refresh/refetch两个计数,startupRetries改用合计预算。trySameSourceRefresh()独立计数,heavy-timeout 重解析不再被提前吃掉。验证
./gradlew :app:testSideloadDebugUnitTest --tests 'com.arflix.tv.ui.screens.player.StartupSourceRecoveryTest':4 tests, 0 failures, 0 errors。compileSideloadDebugKotlin/compileSideloadDebugUnitTestKotlin通过(仅有仓库既有的 deprecation 警告)。git diff --check通过。范围与风险
upstream/main(d1f76342),与 main 无冲突。Related to #817.