Repository navigation
feat(opds): stop sharing when the active library changes - #164
Merged
Merged
Conversation
libcalibre Test Coverage ReportOverall coverage: 80.16% Coverage breakdown available in the artifacts. |
phildenhoff
force-pushed
the
opds-stop-on-library-switch
branch
from
September 22, 2026 07:01
0547c88 to
3174a31
Compare
libcalibre Test Coverage ReportOverall coverage: 80.16% Coverage breakdown available in the artifacts. |
phildenhoff
force-pushed
the
opds-stop-on-library-switch
branch
from
September 22, 2026 07:15
3174a31 to
21ab9e5
Compare
libcalibre Test Coverage ReportOverall coverage: 80.16% Coverage breakdown available in the artifacts. |
phildenhoff
enabled auto-merge (squash)
September 22, 2026 07:26
Opening or creating a library while sharing is active now stops sharing. The running server reads live state, so without this a switch would silently start serving the new library - a privacy surprise, and the books a reader has cached would no longer match their ids.
phildenhoff
force-pushed
the
opds-stop-on-library-switch
branch
from
September 22, 2026 07:29
21ab9e5 to
2a15ea4
Compare
libcalibre Test Coverage ReportOverall coverage: 80.16% Coverage breakdown available in the artifacts. |
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.
Problem
The OPDS server reads live application state, so switching libraries while sharing was active would silently start serving the new library under the old share — a privacy surprise, and the books a reader has cached would no longer match their ids (OPDS ids derive from library identity).
What this does
init_client— the single path that activates a library — now stops the sharing service after a successful switch. Stopping is instant and idempotent (no-op when sharing was off). Creating a library does not activate one, so the onboarding flow is untouched.Testing
Existing state-machine tests cover the stop path (including the drain semantics); this PR is the app-side wiring. 57 OPDS tests green, workspace clean.
Follow-up note for #151
The UI should surface this as "sharing stopped — you opened a different library" rather than silently showing Stopped. (Service-side reason payloads deliberately deferred.)