Repository navigation
Conversation
The phone failed a native or rendition subtitle mount after a fixed 5 s, even when the replanned stream had not published its text tracks yet. Each false failure replanned with subtitle_embedded_failed and cost a whole-file sidecar extraction on the server. Poll the deadline the way TV does: check every 5 s, count only once the current mount exposes any text track, and give up after 30 s regardless. PlayerScreen reports text-track presence for the current mount from onTracksChanged and the selection effect. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
Codex Review SummaryThis 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. |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Track availability reporting androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt |
The adapter accepts a track-availability callback. The view model stores text-track presence for the current subtitle mount, and the screen reports track presence when tracks change and when subtitle selection runs. |
Track-aware mount timeout androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapterTest.kt |
The adapter checks track availability every five seconds and proceeds with mount failure when tracks appear or the 30-second maximum wait is reached. Tests cover delayed track publication, successful mounting, and timeout failure. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant PlayerScreen
participant PlayerViewModel
participant MobileSubtitleTransactionAdapter
PlayerScreen->>PlayerViewModel: Report text-track presence for current mount
PlayerViewModel->>MobileSubtitleTransactionAdapter: Provide mount-aware track availability
loop Every 5 seconds while tracks are unavailable, up to 30 seconds
MobileSubtitleTransactionAdapter->>PlayerViewModel: Check mountable tracks
end
MobileSubtitleTransactionAdapter->>MobileSubtitleTransactionAdapter: Proceed with mount timeout and report failure if unmounted
Suggested reviewers: rxwatcher, rhainland
Merge Risk: 
Moderate · previous review c7a3c
-
Native subtitles can still fall back to sidecar extraction before a newly published track has had time to mount. Give the track its mount deadline before merging.
Security architecture risk: 
Minimal · up to c7a3c
-
The change adjusts when the phone gives up on mounting subtitles without adding access, privileges, or server operations. Existing mount-ownership checks and timeout cancellation remain in place. No material security risk was found to be introduced or worsened.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — Stream-controlled track availability can influence how long a pending subtitle mount waits. The downstream outcome remains the existing native or HLS subtitle-failure replan; the PR does not add a new server operation or increase the authority carried by that callback. Server-side extraction behavior was not independently inspected.
Trust Boundaries and Controls
- inferred — The producer reads live currentTracks after validating the applied mount rather than carrying an event-specific revision. Dependency-level callback ordering remains unverified. Even if stale track presence were accepted, the changed timeout cannot expire before its first five-second wait—the previous unconditional deadline—so this conditional scenario does not establish increased fallback exposure.
Resilience and Maintainability Implications
- observed — Failure is generation-owned and becomes a no-op for a superseded selection or restore. Starting another local mount invalidates the prior owner; successful selection cancels or invalidates its timeout. Failure invalidates ownership before publishing state and invoking fallback, containing stale timeout effects.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
The phone app can now wait up to 30 seconds for a native subtitle mount before reporting failure and falling back to a sidecar ( Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
| delay(LOCAL_MOUNT_TIMEOUT_MS) | ||
| waited += LOCAL_MOUNT_TIMEOUT_MS | ||
| // Only count against the mount once there is something to | ||
| // mount; the onTracksChanged callback may not arrive inside the | ||
| // window at all, so ask rather than wait to be told. | ||
| if (hasMountableTracks() || waited >= MAX_LOCAL_MOUNT_WAIT_MS) break | ||
| } | ||
| failLocalMount(generation) |
There was a problem hiding this comment.
Premature failLocalMount invocation after the first positive hasMountableTracks() poll can trigger native/HLS sidecar recovery before asynchronous selection confirms mounting, especially when tracks appear just before a five-second polling boundary. Start the mount timeout when tracks first become available while preserving the absolute maximum wait enforced by waited >= MAX_LOCAL_MOUNT_WAIT_MS.
Prompt for LLM
File androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt:
Line 1137 to 1144:
Premature failLocalMount invocation after the first positive hasMountableTracks() poll can trigger native/HLS sidecar recovery before asynchronous selection confirms mounting, especially when tracks appear just before a five-second polling boundary. Start the mount timeout when tracks first become available while preserving the absolute maximum wait enforced by waited >= MAX_LOCAL_MOUNT_WAIT_MS.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
…appear The phone checks its native and rendition mount deadline every 5 s and counts it only once the mount has text tracks. It failed at the first check that found tracks, however recently they had appeared: tracks published just before a check left the selection a fraction of a second to confirm, and the false failure replanned for a whole-file sidecar. The window now starts at the first check that finds tracks, or at once when the mount already has them, and the 30 s cap still applies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
|
Superseded by #770, which combines this change with the rest of the stack for review. |
Problem
Related issue: Silo-Server/silo-server#1406
Validation tasks: changes #323 C3, C4
When the phone app switches to a subtitle it plays from the stream itself (a native embedded track or an HLS rendition), it gave the mount a fixed 5 seconds. A replanned stream often hasn't published its text tracks by then, so the app reported a failure that hadn't happened and replanned with
subtitle_embedded_failed. The server then extracted the track as a whole-file sidecar, which on large files on slow storage takes minutes and adds the read load described in Silo-Server/silo-server#1406.The phone now polls the deadline the way Android TV already does.
Approach
PlayerScreenreports whether the current mount has text tracks, fromonTracksChangedand from the selection effect, so the adapter asks for the state instead of waiting for a callback that may not arrive inside the window.Validation
./gradlew testDebugUnitTest: pass, 6,624 tests, 0 failures. New tests cover a stream that has not published text tracks yet and the 30 s cap../gradlew :android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug: pass, no new findings.:androidApp:assembleDebugand:androidTvApp:assembleDebug: pass.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-731/
Risks
A text track that never mounts now takes up to 30 s, instead of 5 s, before the app falls back to the sidecar.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Fix player subtitle mount timeout to poll for native text tracks
The local subtitle mount timeout in
MobileSubtitleTransactionAdapterpreviously failed after five seconds even when the player had not yet published its text tracks. It now polls a track-presence callback every five seconds, and the five-second failure window only starts once tracks are present. Absent tracks fail at a 30-second cap.PlayerScreenreports whether the current Media3 track snapshot has a text track toPlayerViewModelat track-change handling and mounted-subtitle effect execution.PlayerViewModel.onMountedTextTracksChangedstores the current mount's track-presence snapshot and ignores stale mounts;hasMountableTextTracksbacks the adapter's query.scheduleLocalMountTimeoutand the 30-second constant in MobileSubtitleTransactionAdapter.kt.Macroscope summarized ed3c730.