Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to DoplarrChaptarr Rust are documented here.

## Unreleased

### Fixed

- A request for an author's second format now configures that format before
searching. Chaptarr initializes author settings one format per add, so an
author created by `/request book` carries no audiobook quality profile,
metadata profile, or root folder — and an unconfigured format is a
disabled one, whose searches the server empties silently while every
monitor and edition read-back still passes. The author gate write now
fills any missing setting for the requested format and verifies all three
on the read-back, failing closed rather than queueing a search that can
never return a release. Existing values are never overwritten.
- Add bodies now carry only the requested format's root folder. Chaptarr's
existing-author progressive fill collapses both roots into one
audiobook-preferring parameter, so a body carrying both could write the
audiobook path into an unset ebook root.

The write path stays beta: these are fixture-proven only and need the new
mutation case 13 (sequential cross-format, both directions) against a
disposable instance — see `docs/chaptarr/RELEASE_CHECKLIST.md`.

## 4.6.1-chaptarr.1 - 2026-08-28

Fixes the new-author request failure observed live on 2026-07-15. The old bot
Expand Down
112 changes: 104 additions & 8 deletions docs/chaptarr/COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,90 @@ name/path substring inference are gone. A root with `accessible: false` is
never selectable. Do not expose a local root path in a Discord message or
public issue report.

## Author settings are per-format and lazily initialized

`POST /book` configures exactly one format per call, by design. The
controller keeps both formats' fields from the nested `author`
(`BookController.cs:1740-1779` nulls a side only when its quality profile id
is absent), but the add path then collapses to the single requested
`mediaType` — `CreateAudiobook = isAudiobook; CreateEbook = !isAudiobook`
(`AddBookService.cs:492-501`) — and every per-format assignment on the
persisted author is gated on those flags
(`AuthorLibraryService.cs:1700-1780`). The sibling format's five fields
(`{format}QualityProfileId`, `{format}MetadataProfileId`,
`{format}RootFolderPath`, `{format}MonitorExisting`, `{format}MonitorFuture`)
are accepted on the wire and silently discarded; they persist NULL, which
the model documents as "not configured for this media type yet"
(`Author.cs:42`). The intent is explicit repo-wide: the root-folder
defaulter refuses to fill the sibling (`AuthorLibraryService.cs:1845-1847`),
a fixture asserts the sibling stays null
(`AuthorLibraryServiceRootFolderInheritanceFixture.cs:370-393`), and the
first-party UI never sends sibling fields on an add — its "both formats"
option issues two sequential `POST /book` calls
(`frontend/src/Utilities/Author/getNewAuthor.js:66,90`,
`frontend/src/Store/Actions/searchActions.js:929-931`). Confirmed live
(production, 2026-08-29): a new author created by an ebook request persisted
only the ebook settings although the add body carried both formats'.

An unconfigured format is a **disabled** format, with three consequences:

- A `BookSearch` for a row of that format returns zero decisions when the
author has no quality profile for it — Debug log only, the command still
completes as an ordinary no-op
(`ReleaseSearchService.cs:106-113,154-166`). An acknowledged search is
therefore not proof the format is searchable.
- A missing metadata profile excludes that format's remote books at refresh
and **prunes unprotected local rows**, logged at Info:
`[METADATA-PROFILE] No {format} metadata profile configured for author
'…'. Treating {format}s as disabled …`
(`RefreshAuthorService.cs:697-704`). Edition-pinned books stay
un-prunable (`EditionPinPolicy.cs:20`).
- When the server resolves an add of that format to an existing local row,
it rejects the add with a validation error naming the missing metadata
profile (`AddBookService.cs:226-241`).

Three server paths do configure a missing format later:

- **The existing-author catalog add** (`POST /book` when the server has no
local row for the work, `AddBookService.cs:126-129`) progressively fills
the requested format's profiles and monitor fields, fill-only, never
overwriting (`AuthorLibraryService.cs:1044,1126-1137` →
`AuthorService.cs:677-765`). **Root-path landmine:** the call collapses
both roots into one parameter preferring audiobook
(`AuthorLibraryService.cs:1136-1137`), and the fill writes that single
value into whichever format it is configuring
(`AuthorService.cs:714-719,751-757`) — an ebook add whose body carries
both roots therefore writes the **audiobook** root into an unset
`EbookRootFolderPath`. **Every** add body must carry only the requested
format's root, the new-author body included: an add for an author the
server already has routes here regardless of what the client believed
(`AddBookService.cs:126-129` → `AuthorLibraryService.cs:1044`), so a
new-author body carrying both roots reaches the same collapse.
- **The local-row dedupe branch** fills both formats per-format-correctly,
each gated on that format's profile id and root both being present in
the body (`AddBookService.cs:186-224`), before the disabled-format
rejection above is evaluated.
- **`PUT /author/{id}`** applies per-format profile ids only when present
and positive — they can never be cleared this way — but copies **both
root paths unconditionally** (`Author.cs:278-308,329-330`): a body
omitting a configured root silently wipes it, and validation does not
catch a blank path (`AuthorService.cs:890-893`). The author write must
stay a full GET → mutate → PUT round-trip. When a root path is set and
that format's profiles are missing, the update auto-fills them from the
root folder's defaults (`AuthorService.cs:642,909-954`).

Contract consequences: no client may assume the new-author body's
sibling-format settings persisted (they did not), and a sequential
cross-format request against an author created by the other format is safe
only through a path that actually configures the requested format. When the
requested-format row already exists locally, the pipeline performs no add,
so nothing on that path initializes the settings while every monitor and
edition read-back still passes and the acknowledged `BookSearch` is
silently empty. `GET /author/{id}` serializes the per-format profile ids
(`AuthorResource.cs:134-138`), so the author gate write is where the
requested format's settings are filled and verified (safe sequence step 9)
— the only step that can catch that vacuous success.

## Book rows

- `id` and `authorId` identify the local row and parent author; `mediaType` is
Expand Down Expand Up @@ -569,12 +653,18 @@ every silent-write-prone step is more important than minimizing GETs.
Short-circuit an available work or a fully consistent active request. A
bare monitor flag is not proof a search was queued; partial state is
carried forward for repair.
5. If the author is new, `POST /book` with both roots, all four per-format
profile ids, an explicit `mediaType`, every book-level monitor flag false,
only the requested format's `*MonitorFuture` gate true, and search-on-add
false. If the author exists but the work does not, post the selected work
with the local `authorId` and a neutral requested-format edition
placeholder (free-text lookup editions are never carried into writes).
5. Add bodies carry **only the requested format's root** and all four
per-format profile ids. A body carrying both roots routes the audiobook
root into an unset ebook root through the server's progressive fill, and
an add for an author the server already has reaches that fill whether or
not the client thought the author was new (see "Author settings are
per-format and lazily initialized"). If the author is new, `POST /book`
with that root, an explicit `mediaType`, every book-level monitor flag
false, only the requested format's `*MonitorFuture` gate true, and
search-on-add false. If the author exists but the work does not, post the
selected work with the local `authorId` and a neutral requested-format
edition placeholder (free-text lookup editions are never carried into
writes).
6. After any add, wait for the catalog to settle (see "Catalog settling").
7. Resolve the target row: identity match (exact `foreignBookId`, title tier
only when the selection has no work id), format-bound, multi-book titles
Expand All @@ -584,8 +674,14 @@ every silent-write-prone step is more important than minimizing GETs.
edition via `readingFormatId` (English preferred, junk demoted, projected
edition honored). No usable edition stops with an actionable error and a
log of what the server offered.
9. Read the author; enable and re-verify the requested format's
`*MonitorFuture` gate if needed.
9. Read the author; verify the requested format's quality profile id,
metadata profile id, and root folder path are configured, filling any
that are missing through the same full-resource `PUT /author/{id}`
(never a partial body — root paths copy unconditionally) and re-reading
them; then enable and re-verify the requested format's `*MonitorFuture`
gate if needed. Fail closed if a filled setting does not persist: an
unconfigured format silently empties every search and prunes unpinned
local rows on refresh.
10. Select the edition with `PUT /book/{id}` (complete body,
`anyEditionOk: false`, exactly one `monitored: true, manualAdd: true`
edition).
Expand Down
48 changes: 47 additions & 1 deletion docs/chaptarr/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ Run each case once and inspect Chaptarr after every step:
confirm it rejects ebook rows, never changes the author's monitor gates,
and that with the gate closed its `searchForNewBook` search is filtered
out while an explicit `POST /command BookSearch` is not.
13. Sequential cross-format on one author, both directions: create a new
author via `/request book` and later request an audiobook under it
(the same work and a different work), then mirror the direction with
another new author (`/request audiobook` first, `/request book`
second). Restart the bot between the first and second request at least
once. Chaptarr initializes author settings per format lazily
(`COMPATIBILITY.md`, "Author settings are per-format and lazily
initialized"), so the second request is what proves the
missing-format initialization path.

For every case, verify:

Expand All @@ -98,7 +107,23 @@ For every case, verify:
mutation;
- no code path queued `RefreshAuthor` at any point;
- a sparse-metadata row was treated as ordinary requestable data, never as an
"unresolved placeholder".
"unresolved placeholder";
- (case 13) after the first request the author record carries only that
format's settings — the sibling's profile ids and root keys are absent,
per the lazy-initialization contract;
- (case 13) after the second request the author's requested-format quality
profile id, metadata profile id, and root folder path read back equal to
the resolved configuration — in particular the ebook root equals the
configured **ebook** root, never the audiobook path (the
progressive-fill root collapse);
- (case 13) the first format's settings, monitored edition, and files are
unchanged, no duplicate author exists, and each request queued exactly
one acknowledged search.

Assert case 13 against the author record (`GET /author/{id}`), not the
search outcome: on a zero-indexer instance an acknowledged `BookSearch` is
indistinguishable from one `ReleaseSearchService` silently empties for a
missing author quality profile.

## Sprint 1 write-path changes to prove live

Expand Down Expand Up @@ -163,6 +188,27 @@ Nothing in this sprint graduates the write path out of beta; that requires
this checklist's mutation proof against a disposable 0.9.936 instance —
now recorded in `docs/chaptarr/canary/2026-08-28-0.9.936.md`.

## Cross-format sequential settings to prove live

Open as of 2026-08-29. The 2026-08-28 canary's case 4 verified monitoring,
edition selection, and search acknowledgement on a cross-format second
request, but never read the author's per-format settings — and its
zero-indexer instance could not have surfaced the silent search-emptying
that a missing author quality profile causes. Source analysis
(`COMPATIBILITY.md`, "Author settings are per-format and lazily
initialized") has since established that Chaptarr persists only the
requested format's author settings per add, that a second-format request
heals settings only when it triggers an actual `POST /book` (the
progressive fill), and that the fill's single root parameter prefers the
audiobook path. The bot side has since landed: the author gate write fills
and read-back-verifies the requested format's quality profile, metadata
profile, and root folder (fail-closed), add bodies carry only the requested
format's root, and the canary driver now asserts both the requested
format's configuration and the sibling's settings being unchanged. All of
that is fixture-proven only. The next canary must run mutation case 13 in
both directions before any release claims the sequential cross-format
path.

## Promotion record

Save a sanitized release note with the versions, digest, cases run, results and
Expand Down
23 changes: 23 additions & 0 deletions docs/chaptarr/promotion/4.6.1-chaptarr.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ No image or tag moves with this record. The previous production deployment
target; the disposable canary instance was destroyed after the run and
verified gone.

## Known issue found after publication (2026-08-29)

The published build does not configure a second format's author settings.
Chaptarr initializes them one format per add, so an author created by
`/request book` carries no audiobook quality profile, metadata profile, or
root — and an unconfigured format is a disabled one, whose searches the
server empties silently. In this build a later `/request audiobook` for
that author heals the settings only when it triggers an actual `POST /book`
(the server's own progressive fill). When the audiobook row already exists
no add fires, every monitor and edition read-back still passes, and the
acknowledged `BookSearch` can never return a release. The same build also
sends both formats' roots in existing-author add bodies, which the server's
progressive fill can route into the wrong format's root.

Neither is a regression from the Clojure bot and neither affects
single-format use, which is what the canary and the first production run
exercised. Fixed on `chaptarr-cross-format-settings` (author gate write
fills and verifies the requested format's settings, fail-closed; add bodies
carry only the requested format's root); the fix is fixture-proven only and
needs mutation case 13 live before the next release claims the sequential
cross-format path. Contract: `docs/chaptarr/COMPATIBILITY.md`, "Author
settings are per-format and lazily initialized".

## Remaining before beta graduation (Elisha-only)

- [ ] Read-only interaction proof (real Discord bot, real guild,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Existing-author progressive settings collapse both root folders into one parameter, preferring audiobook

Verified against v0.9.936 (develop @ 423b1bb).

## Summary

Thanks for Chaptarr. We build a Discord request bot against the v1 API. When
`POST /api/v1/book` adds a work under an existing author through the catalog
path, `ApplyExistingAuthorProgressiveSettings` hands
`UpdateAuthorProgressiveSettings` a single root-folder path shared by both
formats, computed as `config.AudiobookRootFolderPath ??
config.EbookRootFolderPath`. The progressive fill then writes that one value
into whichever format it is configuring. An ebook add whose nested `author`
carries both formats' root paths therefore persists the **audiobook** root
as the author's `EbookRootFolderPath`, and later ebook imports for that
author organize into the audiobook library.

The inline comment acknowledges the collapse ("Single path param: prefer
audiobook path if present else ebook"). The dedupe branch in
`AddBookService` does not have the defect — it calls the same method once
per format and passes each format's own root.

## Reproduction sketch

1. An author exists configured for audiobooks only (created by an
audiobook-only add — the intended lazy per-format initialization).
2. `POST /api/v1/book?mediaType=ebook` for a work with no local row, the
nested `author` carrying `ebookQualityProfileId`, `ebookRootFolderPath`,
and — as a client reusing one author payload naturally does — the
audiobook fields as well.
3. `BuildRequestedBookMonitoringConfig` copies both roots into the config;
`CreateEbook = true`, `CreateAudiobook = false`. The per-format profile
arguments for audiobook are nulled by the `CreateAudiobook` gates, but
the shared root parameter is not gated and resolves to the audiobook
path.
4. Inside `UpdateAuthorProgressiveSettings`, the ebook block runs (its
quality profile id is present), finds `EbookRootFolderPath` unset, and
fills it with the shared parameter — the audiobook root.

## Source citations (file:line, verified)

- `src/NzbDrone.Core/Books/Services/AuthorLibraryService.cs:1126-1137` —
the call site; line 1137 collapses both roots with the
audiobook-preferring `??` under the "Single path param" comment.
- `src/NzbDrone.Core/Books/Services/AuthorService.cs:677-765` —
`UpdateAuthorProgressiveSettings`; the ebook block writes the shared
`rootFolderPath` parameter into `EbookRootFolderPath` at `:751-757`
(audiobook mirror at `:714-719`).
- `src/NzbDrone.Core/Books/Services/AddBookService.cs:492-512` —
`BuildRequestedBookMonitoringConfig` copies both formats' roots into the
config ungated, so the collapse point sees both.
- `src/NzbDrone.Core/Books/Services/AddBookService.cs:186-224` — the
dedupe branch calling the same method with each format's own root
(`:205`, `:222`), showing the intended per-format shape.

## Suggested fix

Pass both roots through — either two parameters or one call per format, as
the dedupe branch already does — and fill each format only from its own
root.

## Workaround

A client can avoid the wrong-root fill by sending only the requested
format's root path in every add body, so the `??` never has a sibling path
to prefer. It has to be every body, not just the ones the client believes
are for an existing author: an add for an author the server already has
routes through this same path whatever the client assumed
(`AddBookService.cs:126-129` → `AuthorLibraryService.cs:1044`).
Loading