Repository navigation
Leaving a book mid load closes its server session, and a restarted book resumes where you left it - #112
Merged
Conversation
…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
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. |
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.
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
Evidence
🤖 Generated with Claude Code
https://claude.ai/code/session_014XfNSbF1fe9aiDwGMCNLmj