Skip to content

fix(audiobook): start a fresh session when the server expired the old one - #708

Merged
Quick104 merged 6 commits into
Silo-Server:mainfrom
Rhainland:fix/1253-audiobook-reconnect
Nov 5, 2026
Merged

Quick104 merged 6 commits into
Silo-Server:mainfrom
Rhainland:fix/1253-audiobook-reconnect

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server#1253
Validation tasks: unblocks #349 C5; unblocks #350 C5

If the server is unreachable long enough for an audiobook's playback session to expire (about 70 s or more), the Android player can't recover once it's back. The next seek outside the buffer, or the next chapter, stops with "Playback session not found", and Play does nothing; the user has to leave the player and start again. On Android TV the error screen has nothing to focus, so the remote can't even dismiss it.

The player now starts a new session at the same position when the server reports the old one is gone, and every remaining error offers a retry.

Approach

After expiry the server answers the stream with 410 and replan or progress with 404 not_found "Playback session not found"; the client already recognises that problem. Audiobook sessions are sequenced v3 sessions, for which the shared session lifecycle only logs a 404, so the audiobook's existing renewal path never ran. A replan or reanchor that gets session-not-found now starts a fresh session at the player's position through the same renewal code. Any other failure sets a retry state: on phone and tablet Play stays enabled and starts playback again, and on TV the error screen shows a focused Retry button and Back. Video playback and the shared session lifecycle are unchanged. On TV, the error screen's Back, the Back key and the Stop button now share one exit routine.

A renewal checks that it is still current after looking up the profile: a seek, track load or close made during that lookup wins. Retry keeps the position the book was opening at, or the position the user sought while the error showed, instead of starting at 0:00. Player position polls are ignored while no stream is loaded, so the empty player can't reset that position.

Validation

  • Unit test for the replan-recovery classifier (session gone → renew; other errors → retry); it failed before the change. The view model and Media3 wiring are covered by the emulator runs.
  • Unit tests, lint (all CI tasks) and supply-chain scripts for both apps: pass, except ReflowStyleTest > line height flows from settings in the phone app, which this change doesn't touch.
  • Emulator, against silo-server e6df1d8ed, server cut by stopping the network relay, session expiry confirmed through the admin sessions API. Phone: before, an 80 s cut then Next chapter gave "Playback session not found" and Play didn't recover. After, an 85 s cut followed by a seek, and a 170 s cut with a seek during the outage, both started a fresh session and kept playing (at 2:00:12 and 3:00). Android TV (Android 14): before, a full-screen error with nothing to focus; after, two runs recovered at the next chapter, and the error screen shows Retry focused with Back below it.
  • Tablet not run separately; it uses the phone app's player.
  • Maintainer review fix (dc1101a): a replan that answers 410 playback_session_ended (an administrator ended the session) no longer offers Retry. The classifier test covers the new outcome, and both apps compile. Not run on a device.

Evidence

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

Surface and build: Android phone (Android 16) and Android TV (Android 14) audiobook player, Hours of Static; before on origin/main e9c410096, after on this branch; same synthetic book.

Risks

The server-reanchor path (seeking outside the window of a server-produced stream) still has no retry for failures other than an expired session, and a retry there could restart at the pre-seek position. Android audiobooks always direct-play today, so that path doesn't run; it should be fixed together with any server-produced audio route (Silo-Server/silo-server#3175).

While a player is still playing from its buffer after an outage, progress reports keep failing until it needs more data, which is when the new session starts. Starting it on the first failed progress report would change the session lifecycle that video shares, so that is left for a follow-up.

A same-part seek made while a renewal request is in flight is lost: the renewal starts at the position it captured. The replan path on main has the same window.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (T3 Code)
  • Tool(s): Claude Code, Codex CLI, GitHub CLI, Gradle, Android Emulator, adb
  • Model(s): claude-opus-5-5; gpt-6.1-sol (review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Two rounds of independent Claude Opus 5.5 and GPT 6.1 Sol reviews of the branch diff (correctness, repo standards, the bug as described). Both found that failures on the server-reanchor path still lack a correct retry, plus a race between two renewals of one expired session. A follow-up commit tried to cover them; the second review found it restarted at the pre-seek position. Because Android audiobooks never take those paths today, that commit was reverted and the gap is listed under Risks. Opus's note about a duplicated TV exit sequence was fixed. Maintainer review (Claude Opus 5.5 with a GPT 6.1 Sol cross-provider round, reviewed 37d6d4b): Retry after an administrator-ended session was fixed in dc1101a; a paused book starting when a new stream mounts predates this PR and is tracked in [bug] Paused audiobook starts playing when a new part or session stream loads #779.

Note

Start a fresh audiobook session when the server expired the old one

  • Adds AudiobookReplanRecovery to classify failed replan and reanchor results as StartFreshSession, Ended, or Fail in AudiobookPlayerViewModel.kt. Missing-session errors trigger a fresh session at the current position; server-ended sessions are recorded in UI state and block retry via canRetryPlayback.
  • Adds retryPlayback so the play control restarts detail loading, a timeline track, or a single-file session from the stored position when retry is available.
  • Hardens renewExpiredSession against races: renewal results are discarded when a newer load, seek, or close occurred, and ready sessions returned late are stopped.
  • Position callbacks and seeks without a published stream now update the stored position instead of overwriting or ignoring it, so a later retry uses the correct point.
  • TV error screens gain Back and Retry actions with focus handling, and the Android play control stays enabled in retryable error states.
  • Behavioral Change: togglePlay now retries playback instead of only toggling pause when canRetryPlayback is true; applyFailedSessionStart takes a new sessionEndedByServer argument.

Macroscope summarized dc1101a.

… one

After an outage longer than the server's session grace, the server stops the
audiobook's playback session. The next stream request then gets 410, the
recovery replan gets 404 "Playback session not found", and the player showed
that as a terminal error: Play did nothing and the viewer had to leave the
player and start again.

A replan or reanchor that answers session-not-found now starts a fresh
session for the same file at the position the player held, the way the
heartbeat-driven renewal already did. Any other playback failure leaves Play
(and the TV error screen's new Retry action) able to start playback again at
the current position, and the TV error screen now has a focused action and a
Back action instead of none.
Three gaps in the expired-session recovery:

- A server reanchor that failed for any reason other than an expired
  session only set the error and kept the old stream, so Play and the TV
  Retry action had nothing to restart. It now ends the stream the same way a
  failed replan does, keeping the seek target as the position to resume.
- After a failure cleared the stream, the 250 ms position poll kept reading
  the outgoing Media3 item and wrote its player-relative time over the
  position Retry resumes from. Polls of any item other than the published
  stream are now ignored.
- A renewal driven by a progress 404 could replace a seek's renewal of the
  same expired session and resume at the last reported position instead of
  the seek target. Only one renewal now runs per stale session.
…r a failure"

The change covered the server-reanchor failure path and lifecycle-driven
renewal, which audiobooks on Android don't use today (they always direct-play),
and review found it kept the pre-seek position on retry. Leave those paths as
they were until a server-produced audio stream exists to test them against.
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 20 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96cf608c-15ed-4077-9f31-630118e4b8a0
Commits

Reviewing files that changed from the base of the PR and between 548617c and dc1101a.

Files selected for processing: 4
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/AudiobookReplanRecoveryTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/audiobook/AudiobookPlayerScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/audiobook/TvAudiobookPlayerScreen.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Oct 27, 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 impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish labels Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown

Evidence is incomplete:

  • The shared playback recovery and retry state reach the Android phone, tablet, foldable (folded and open), and TV. The Evidence section identifies phone and TV runs, but no tablet or foldable captures; “uses the phone app’s player” confirms the tablet path is reached. Please add before/after player captures for a tablet and a foldable folded and open, and include a recording of the recovery flow.
  • The phone Play retry control also reaches tablet and foldable layouts. Please include before/after captures of that state for those form factors.

The linked evidence page should show the phone and TV captures as well, including a recording of the TV error screen’s focus landing on Retry/Back.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

capabilities: ClientCodecCapabilities? = null,
clientPlaybackContext: ClientPlaybackContext? = null,
) {
val profileId = profileRepository.getActiveProfileId() ?: return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules critical

Race condition identified in session renewal: a newer seek or track load can advance loadGeneration while profileRepository.getActiveProfileId() suspends, and the subsequent increment makes the obsolete renewal current again, allowing its old position to replace newer playback intent. Capture loadGeneration before the lookup and afterward reject renewal if the generation changed, isClosing is true, or _uiState.value.sessionId no longer matches staleSessionId.

Also found in:

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt:1247-1247

Kody rule violation: Revalidate asynchronous ownership before publication, launch, and cleanup

val generationBeforeProfileRead = loadGeneration
val profileId = profileRepository.getActiveProfileId() ?: return
if (
    generationBeforeProfileRead != loadGeneration ||
    isClosing ||
    _uiState.value.sessionId != staleSessionId
) return
Prompt for LLM

File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt:

Line 294:

Race condition identified in session renewal: a newer seek or track load can advance loadGeneration while profileRepository.getActiveProfileId() suspends, and the subsequent increment makes the obsolete renewal current again, allowing its old position to replace newer playback intent. Capture loadGeneration before the lookup and afterward reject renewal if the generation changed, isClosing is true, or _uiState.value.sessionId no longer matches staleSessionId.

**Also found in:**
- `android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt:1247-1247`

Suggested Code:

        val generationBeforeProfileRead = loadGeneration
        val profileId = profileRepository.getActiveProfileId() ?: return
        if (
            generationBeforeProfileRead != loadGeneration ||
            isClosing ||
            _uiState.value.sessionId != staleSessionId
        ) return

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 37d6d4b: the renewal records the load generation before the profile lookup and stops if it changed, the player is closing, or the session ID changed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks—the guard described in 37d6d4b42 addresses this race by rejecting an obsolete renewal after the profile lookup, before it can advance loadGeneration and override newer playback intent.

I haven’t independently verified the commit, but the described fix matches the suggestion.

Comment on lines +1250 to +1254
startSingleFileSession(
fileId = fileId,
profileId = profileId,
startGlobal = state.positionSeconds,
generation = generation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

Resume offset loss occurs when the initial single-file session start fails: loadDetail resolves startGlobal, but neither loadDetail nor the failed start publishes it to uiState.positionSeconds before Retry reads state.positionSeconds, causing a book opened at a saved or explicitly requested nonzero position to restart at 0:00. Retain the attempted start position on failure and use it for the next startSingleFileSession call.

Prompt for LLM

File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt:

Line 1250 to 1254:

Resume offset loss occurs when the initial single-file session start fails: loadDetail resolves startGlobal, but neither loadDetail nor the failed start publishes it to uiState.positionSeconds before Retry reads state.positionSeconds, causing a book opened at a saved or explicitly requested nonzero position to restart at 0:00. Retain the attempted start position on failure and use it for the next startSingleFileSession call.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 37d6d4b: the single-file start publishes its start position before the request, and position polls are ignored while no stream is published, so Retry resumes at the saved position instead of 0:00.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for fixing this in 37d6d4b42. Publishing the attempted start position before the request and ignoring position polls while no stream is published addresses the reported offset loss: Retry retains the saved or explicitly requested position instead of restarting at 0:00.

@Rhainland

Copy link
Copy Markdown
Contributor Author

Not adding tablet/foldable captures. The recovery logic is in the shared ViewModel, and the Retry control's layout is unchanged from the existing error state. The phone and Android TV runs on the evidence page show the recovery flow.

…nd retry

- A session renewal claimed the load generation only after the active
  profile lookup returned. A seek, track load or close in that window
  was then superseded by the older renewal, which restarted at its old
  position. The renewal now notes the generation before the lookup and
  gives up if it moved, the player is closing, or the session changed.
- When the first start of a single-file book failed, Retry resumed from
  0:00 instead of the saved position: the position was set only once a
  session started, and the 4 Hz poll of the empty player then wrote 0
  over it. The start position is now published before the request, as
  the multi-part path already does, and polls are ignored while no
  stream is published, so a seek made in the error state is recorded
  directly.
@silo-kody

silo-kody Bot commented Oct 28, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Validate download ownership before publishing subtitle bytes
  • Bind playback markers to the actual playing file
  • Share route-aware audio decisions and preserve original-format decoder fallback
  • Apply playback route eligibility consistently at admission and media loading

@macroscopeapp

macroscopeapp Bot commented Oct 28, 2026

Copy link
Copy Markdown

The latest commit changes the user-visible retry position: after a failed first single-file start, retry now preserves the saved or sought position. This shared ViewModel reaches the phone app on phones, tablets, and foldables (folded and open), as well as Android TV. The Evidence section identifies phone and TV runs, but not tablet or foldable captures; the linked page should show this retry flow on those missing form factors.

Suggested fix: No diff; add a recording of a failed start followed by retry at a nonzero position on a tablet and a foldable, both folded and open.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 37d6d4b. One finding, inline below. I'm fixing it in a commit on this branch, so there's no need to change it yourself.

🤖 Claude Code (claude-opus-5-5)

…ssion

A replan that answers 410 playback_session_ended means an administrator
stopped the session, and the server answers that way so the player exits
instead of starting a fresh one. The replan classifier treated it like any
other failure, which left canRetryPlayback true: the phone Play button and
the TV Retry action then started a new session with one tap.

Classify it as Ended and keep Retry off while the UI state carries
sessionEndedByServer. Phone Play stays disabled and the TV error screen
offers only Back, as before this branch. A newly published session clears
the flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 1, 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 ❌

@Quick104

Quick104 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: dc1101a (the branch at 37d6d4b plus one fix commit from this review).

Fit: 8/10 · Readiness: 8/10 — conditional (assuming CI is green)

The PR fixes a real gap that blocks Android's network-interruption validation case (C5 on #349 and #350). After an outage longer than the server's session grace, the audiobook player now starts a fresh session where it used to stop for good. It hooks in at the right place: the replan and reanchor paths that already receive the server's "session not found" answer. The shared session lifecycle never reports a missing sequenced session, so the old renewal path couldn't run for audiobooks. Video playback and the shared lifecycle are unchanged.

Addressed in this review

  • Retry restarted a session an administrator ended (Medium, fixed in dc1101a). A 410 playback_session_ended replan now classifies as Ended. Retry stays off for it, so the phone Play button stays disabled and the TV error screen shows only Back. The server sends that answer so the player stops instead of starting over, and the video player already leaves playback on it.
  • Kody's two earlier findings are fixed correctly at 37d6d4b. The renewal checks the load generation before the profile lookup, and the single-file start publishes its position before the request while polls are ignored until a stream exists.

Left for maintainers

  • Evidence: the page covers phone and Android TV. Tablet and foldable weren't captured. The repository rule asks for each device the change reaches, or a reason it's unaffected. They run the same phone player, but the rule asks for captures.
  • Pre-existing, filed as [bug] Paused audiobook starts playing when a new part or session stream loads #779: mounting a new stream always starts playback, even when the book is paused. Main does this today when a paused multi-part book seeks into another part. This PR adds one more path to it: pausing while a renewal is in flight.
  • Low, not fixed: a same-part seek made while a renewal request is in flight is lost. The renewal starts at the position it captured. The replan path on main has the same window. Before this PR, that state ended in an error anyway.
  • Pre-existing, not filed: the audiobook player doesn't listen to the session lifecycle's "server ended this session" events the way the video player does. After an administrator ends the session, the book keeps playing from its buffer until it needs more data.
  • Disclosed in the PR: the server-reanchor path still has no retry for failures other than an expired session. Android audiobooks direct-play today, so that path doesn't run.

Verification

  • The new classifier test passes, and the phone and Android TV apps compile with the fix. The test calls code this PR adds, so it can't run on the base and doesn't count as proof of the fix. The author's before-and-after emulator runs on phone and Android TV are the evidence for the recovery itself. I didn't repeat them.
  • Cross-provider review: GPT 6.1 Sol (Codex) at 37d6d4b reported three findings. The administrator-ended Retry is fixed above. The paused-mount issue is [bug] Paused audiobook starts playing when a new part or session stream loads #779. The lost same-part seek is the low item above.

Validation

No case recorded as passed on the 1.0 board touches the audiobook player. Validation tasks: unblocks #349 C5; unblocks #350 C5 is right as written. The PR covers the expired-session part of C5, not token refresh or sign-in recovery.

User manual and parity

  • Manual: unaffected. The audiobooks page doesn't describe player errors or recovery.
  • Apple: no paired PR or issue. The Apple audiobook player starts a new session for each seek outside its window, but a stream failure during playback only shows an error. I recommend a parity issue in silo-apple to check expired-session recovery and Retry there.

🤖 Claude Code (claude-opus-5-5)

Comment on lines +1412 to +1414
AudiobookReplanRecovery.Ended,
AudiobookReplanRecovery.Fail ->
_uiState.update { it.copy(error = result.message.ifBlank { "Seek failed" }) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug high

Incomplete session cleanup in the seek-reanchor Ended branch only sets error after a 410 playback_session_ended response, leaving sessionEndedByServer false and retaining the stream, session, and unpaused state so buffered audio can continue after the administrator's stop. Handle Ended separately with applyFailedSessionStart(message, expectedSessionId = sessionId, sessionEndedByServer = true), as onPlayerError does.

AudiobookReplanRecovery.Ended -> applyFailedSessionStart(
    result.message.ifBlank { "Seek failed" },
    expectedSessionId = sessionId,
    sessionEndedByServer = true,
)
AudiobookReplanRecovery.Fail ->
    _uiState.update { it.copy(error = result.message.ifBlank { "Seek failed" }) }
Prompt for LLM

File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudiobookPlayerViewModel.kt:

Line 1412 to 1414:

Incomplete session cleanup in the seek-reanchor Ended branch only sets error after a 410 playback_session_ended response, leaving sessionEndedByServer false and retaining the stream, session, and unpaused state so buffered audio can continue after the administrator's stop. Handle Ended separately with applyFailedSessionStart(message, expectedSessionId = sessionId, sessionEndedByServer = true), as onPlayerError does.

Suggested Code:

                                AudiobookReplanRecovery.Ended -> applyFailedSessionStart(
                                    result.message.ifBlank { "Seek failed" },
                                    expectedSessionId = sessionId,
                                    sessionEndedByServer = true,
                                )
                                AudiobookReplanRecovery.Fail ->
                                    _uiState.update { it.copy(error = result.message.ifBlank { "Seek failed" }) }

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@Quick104
Quick104 merged commit e9861fa into Silo-Server:main Nov 5, 2026
10 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 impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants