Skip to content

fix(player): leave playback when an administrator ended the session - #548

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/exit-player-on-admin-stop
Oct 13, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/exit-player-on-admin-stop

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server#1205
Validation tasks: unblocks #340 C2, #341 C2

When an administrator stops a session while the Android phone, tablet or TV player can't be reached over its control socket, the player doesn't stop. A phone or tablet keeps playing what it has buffered while the session is already gone from Activity, and the progress journal retries forever with a "Playback progress is pending" warning. An Android TV playing a transcode ends on a "Source error" screen with Retry.

With Silo-Server/silo-server#2280 the server answers progress and replan for such a session with 410 playback_session_ended. This change makes the player leave on that answer.

Approach

The playback lifecycle reports a 410 playback_session_ended progress answer to its owner (sequenced and legacy reporting alike) instead of retrying it, and a replan that gets the same answer no longer shows an error. The phone and TV player view models then leave playback through the same path as a stop delivered over the control socket. Renewal on 404 is unchanged.

Needs Silo-Server/silo-server#2280; against an older server the 410 never appears and nothing changes.

Validation

  • Android tablet and Android TV emulators against a local server with the server change, with the control socket taken over by a silent connection before the admin stop: the player left playback (tablet to Home, TV to Home with focus on the title) and no new session started. Before this change the tablet kept playing unlisted and the TV showed a source error.
  • Phone, tablet and TV: pause, resume, message and stop over the control socket behave as before.
  • :android-shared:testDebugUnitTest for the lifecycle: pass. Both apps assemble.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/pr-548/

Risks

None identified.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code (Bash, file edits, subagents), GitHub CLI (gh), Android emulator, adb and Gradle
  • Model(s): Claude Opus 5.5 (claude-opus-5-5)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code review pass (/code-review, medium) covered this branch with the server and Apple branches. It reported no correctness findings for this branch. This was an AI self-review; no independent human review is claimed.

When an administrator stops a session while the player cannot be reached over
its control socket, the server now ends the attempt and answers progress and
replan with 410 playback_session_ended. The phone, tablet and TV players kept
playing: the sequenced progress journal retried the sample forever and showed a
pending-progress warning, and a recovery replan surfaced an error over the
player.

The playback lifecycle now reports such a session, and both player view models
leave playback on it, or on a replan that gets the same answer, through the
same path as a stop delivered over the control socket.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T17:32:36.245568Z bd3a225 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2fd88c3c-8f51-4266-b216-8bad17b4b652

📥 Commits

Reviewing files that changed from the base of the PR and between 538aa09 and a8da533.


📒 Files selected for processing (6)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycle.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycleTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileRecoveryReplan.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileRecoveryReplanTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@silo-kody

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes impact: playback Can't play, stalls, or wrong media priority: P1 Core-path bug; painful workaround — next after P0 labels Oct 11, 2026
@silo-triage

silo-triage Bot commented Oct 11, 2026

Copy link
Copy Markdown

Evidence is missing for the changed playback behavior. Please add before/after captures and a short recording on Android mobile and TV showing an administrator stop with the control socket unavailable: playback exits instead of continuing or showing the source error, and TV focus returns correctly. Identify the builds used; the validation notes alone do not show these changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd3a225232

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A 410 playback_session_ended answer to a subtitle_embedded_failed replan was
treated as a failed subtitle fallback, so the phone said playback continues.
It now leaves playback like the TV does.
@silo-kody

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Rhainland

Copy link
Copy Markdown
Contributor Author

Evidence is published: https://evidence.siloserver.org/r/silo-android/pr-548/

It has before and after recordings plus a screenshot 30 s after the stop for the Android mobile app (on a Pixel Tablet emulator) and Android TV. Each run takes over the control socket with a silent connection, then sends the admin stop. Before: the tablet keeps playing a session that is gone from Activity, and the TV ends on a source error. After: both return to Home, the TV with focus on the title, and no new session starts. Builds: before is silo-android main 97f6773 with silo-server main; after is this branch at bd3a225 with Silo-Server/silo-server#2280. The later commit a8da533 only changes the phone's subtitle-recovery replan path.

AI disclosure: written with Claude Code (claude-opus-5-5).

@Quick104
Quick104 merged commit 3bf2f68 into Silo-Server:main Oct 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes impact: playback Can't play, stalls, or wrong media priority: P1 Core-path bug; painful workaround — next after P0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants