Skip to content

Leaving a book mid load closes its server session, and a restarted book resumes where you left it - #112

Merged
StaticHumStudio merged 4 commits into
masterfrom
fix/220g-playback-followups
Nov 2, 2026
Merged

StaticHumStudio merged 4 commits into
masterfrom
fix/220g-playback-followups

Conversation

@StaticHumStudio

Copy link
Copy Markdown
Owner

Fixes #105. Fixes #106.

What changes for the listener

Leaving a book's page mid load no longer leaves a server session open (#105). Any load that ends without its book becoming current (you left the page, it failed, or a newer load replaced it) now closes the session it opened, but only if that session is still the player's. The open request runs in the playback scope, so leaving the page ends the wait, not the request. A session that answers after the load gave up (including a downloaded book past its 5 second limit) is refused and closed at once. The staged mini player book is still cleared first, per #107.

A restarted book resumes where you left it (#106). A finished book still starts over at 0:00. Before this, a stale end position held in memory or in a lagging server session could beat the saved spot on reload, and the finished book reset then sent the listener back to 0:00. An end of book position now counts as a record of a finish, never as a newer spot. One shared rule, positionAtBookEnd (last second of the book or past it), now drives both the stop's finish check and the load, so a stop half a second from the end no longer reopens at the end and finishes again.

Choices worth knowing

  • Finished books start over. That's the existing behavior from ee82a42, kept on purpose.
  • If a book was finished on another device and this phone still has an older saved spot, it resumes at that spot until the finish syncs down.
  • A request still in flight when the app process dies can still leave a session, and the server times it out. Same as before.

Evidence

🤖 Generated with Claude Code

https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj

StaticHumStudio and others added 4 commits November 2, 2026 16:07
…ened

Leaving a book's page cancels its load. If the load had already opened a
listening session on the server, that session stayed open until some later
load or stop happened to find it, and stayed open for good when nothing
came next. Now any load that ends without making its book current (left,
failed or superseded) closes the session it opened, as long as it is still
the player's session. A newer load that already took it, or opened its
own, is left alone, so opening another book right after leaving still
closes only the abandoned session. The close runs in the playback scope,
so the cancelled page cannot stop it. The mini player still drops the
loading book first, as before (#105).

Closes #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj
… 0:00

A finished book starts over at 0:00 on its next load, which is the end of
book reset added with the finished book fix. But once you had listened a
while after that restart, the book object kept in memory (and a server
session that had not caught up) still said the book was at its end. A
reload took the larger position, so the stale end beat your saved spot,
and the end of book reset then sent you back to 0:00 (#106).

An end position held in memory now counts as a record of a finish, not as
a newer spot. It never beats a saved position, and a mid book position
held in memory beats it too. A book reloaded straight after it finished
still starts over, and a newer position from the server still beats an
older saved one.

Closes #106

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj
…s too

A stop within the last second of a book saves it as finished, but the
reload only treated a position at or past the very end as the end. So a
book stopped half a second short, restarted and played for ten minutes
could still lose to that stale spot on reload, and then seek back to its
last half second and finish again. The stop and the load now share one end
of book rule with the same one second window, which also covers a player
track sum that runs a little short of the server's length (#106).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj
…en its answer lands

The open request ran inside the load, so leaving the page mid request, or
the 5 second limit on a downloaded book, cancelled it. The server had
usually opened the session already, but the app never learned its id and
nothing closed it. The open now runs in the playback scope and the load
only waits on it. Leaving or timing out ends the wait, not the request.
When a late answer arrives after the load stopped waiting, the load
refuses it and the opener closes it at once. An answer that arrives in
time belongs to the load as before, and the load's end closes it unless
the book became current. A downloaded book still starts playing after 5
seconds without a session, as before (#105).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T22:52:31.633554Z 8e3afe6 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.

@StaticHumStudio
StaticHumStudio merged commit 8084db9 into master Nov 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A book reloaded from its end can restart at 0:00 Leaving a book's page mid load leaves its server session open

1 participant