Repository navigation
fix: configure the requested format's author settings before searching - #4
Merged
Merged
Conversation
Verified against Chaptarr v0.9.936 (develop @ 423b1bb) after the first production run of 4.6.1-chaptarr.1 surfaced an author carrying only the requested format's settings. POST /book configures exactly one format per call by design: the add path collapses to the requested mediaType (AddBookService.cs:492-501) and every per-format author assignment is gated on those flags (AuthorLibraryService.cs:1700-1780), so the nested author's sibling-format settings are accepted and discarded. An unconfigured format is a disabled format - searches are silently emptied, remote books excluded, unpinned local rows pruned on refresh. Two consequences for this bot, both previously undocumented: - When the requested-format row already exists, no add fires, nothing initializes the settings, every read-back passes, and the acknowledged BookSearch is silently empty. Safe-sequence step 9 now requires verifying and filling the requested format's settings through the full-resource author PUT, failing closed. - The server's progressive fill collapses both roots into one audiobook-preferring parameter (AuthorLibraryService.cs:1136-1137), so an add body carrying both roots writes the audiobook root into an unset ebook root. Safe-sequence step 5 now sends only the requested format's root; the defect is drafted for upstream. The 2026-08-28 canary's cross-format case verified monitoring only and its zero-indexer instance could not surface the silent search-emptying, so the checklist gains mutation case 13 (both directions, author-record assertions) and an open prove-live section.
Chaptarr initializes author settings one format per add, so an author created by /request book carries no audiobook profile ids or root - and an unconfigured format is a disabled one, whose searches the server empties silently. Every monitor and edition read-back still passed in that state, so a second-format request could report success and queue a BookSearch that could never return a release. The author gate write now fills any missing quality profile, metadata profile, or root folder for the requested format and verifies all three on the read-back, failing closed. The fill is fill-only, mirroring the server's own progressive semantics: a profile already on the author was chosen deliberately and outranks configuration. The write stays a full GET-mutate-PUT round-trip because the update copies both root paths unconditionally, so a partial body would wipe the other format. Both add bodies now send only the requested format's root. The server's existing-author progressive fill collapses both roots into one audiobook-preferring parameter, so a body carrying both wrote the audiobook path into an unset EbookRootFolderPath. The canary driver gains the assertions checklist case 13 needs: the requested format configured after a completed request, and the other format's settings unchanged. Integration fixtures gain the per-format settings a configured author actually carries, matching author.json; every existing request sequence is unchanged, which is what confirms the new write fires only for an unconfigured format.
…thor An adversarial review of the fix caught the contract contradicting the code: safe-sequence step 5 still opened with "If the author is new, POST /book with both roots", because the narrowing was written before the code change and scoped only to the existing-author branch. The code narrows both bodies, and a unit test forbids the sibling root in either - so the normative wire contract prescribed a shape the code refuses to produce, in the section a future change would consult. The rule belongs on every add body: an add for an author the server already has routes through the progressive fill whatever the client believed, so a new-author body carrying both roots reaches the same collapse. Records the release known-issue note and the changelog entry for the fix as well.
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.
What
Chaptarr initializes author settings one format per add — by design, not a bug.
AddBookService.cs:492-501setsCreateAudiobook/CreateEbookfrom the single requestedmediaType, and every per-format assignment inAuthorLibraryService.cs:1700-1780is gated on those flags. The nested author's sibling-format settings are accepted on the wire and discarded.An unconfigured format is a disabled format:
ReleaseSearchService.cs:106-113returns zero decisions when the author has no quality profile for that media type, andRefreshAuthorService.cs:697-704excludes its remote books and prunes unpinned local rows.So a request for an author's second format could report success and queue a
BookSearchthat could never return a release. Every monitor and edition read-back still passed — the state is invisible to all of them.Found after the first production run of
4.6.1-chaptarr.1; the published build has both defects below. Neither is a regression from the Clojure bot and neither affects single-format use, which is all the 2026-08-28 canary exercised.Changes
The author gate write configures the format. It now fills any missing quality profile, metadata profile, or root folder for the requested format and verifies all three on the read-back, failing closed. Fill-only, mirroring the server's own progressive semantics — a profile already on the author was chosen deliberately and outranks config. The write stays a full GET→mutate→PUT round-trip because
Author.cs:329-330copies both root paths unconditionally, so a partial body would wipe the other format.Add bodies carry only the requested format's root. The server's progressive fill collapses both roots into one audiobook-preferring parameter (
AuthorLibraryService.cs:1136-1137→AuthorService.cs:714,751), so a body carrying both wrote the audiobook path into an unsetEbookRootFolderPath. Applied to both bodies: an add for an author the server already has reaches that fill whatever the client believed.The canary can now gate this.
verify_requestnever read a profile or root field, so checklist case 13 was not actually runnable. It now asserts the requested format is configured and the other format's settings are unchanged.Docs. New
COMPATIBILITY.mdsection with verified v0.9.936 citations; safe-sequence steps 5 and 9 amended; mutation case 13 (both directions, author-record assertions) and an open prove-live section inRELEASE_CHECKLIST.md; upstream-issue draft for the root collapse; known-issue note on the4.6.1-chaptarr.1promotion record.Testing
Test-driven — each test written and watched fail before the code.
requested_format_settings_that_do_not_persist_fail_closedreturnedOkagainst the old code, which is the vacuous success reproduced. The end-to-end test was separately verified to fail with the fill disabled, so it is not a test that merely passes alongside the fix.Fifteen existing integration fixtures gained the settings a configured author carries, matching
author.json. Every test's asserted request sequence is unchanged — that is the evidence the new write fires only for an unconfigured format.Gates:
cargo fmt --checkclean, 131 workspace tests pass, clippy clean on default andcanaryfeatures.A 4-dimension adversarial review (18 findings, 16 refuted on verification) confirmed one real defect: safe-sequence step 5 still prescribed both roots on the new-author add, contradicting the code and a test. Fixed in
f89a4c2.Not proven
Fixture-proven only. No live server has confirmed the settings PUT persists, so per the drift policy the write path stays beta until mutation case 13 runs against a disposable instance in both directions.