Repository navigation
fix: make Chaptarr book requests converge safely - #3
Merged
Merged
Conversation
elbrielle
force-pushed
the
claude/sweet-carson-g5599o
branch
from
July 16, 2026 06:22
fff63a0 to
5683f39
Compare
elbrielle
marked this pull request as ready for review
July 16, 2026 16:51
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 this fixes
The July 15 Robin Hobb request exposed a false-success path. While Chaptarr was still importing the new author's large catalog, the bot selected a Farseer collection row, wrote monitor state too early, and queued a search that completed with no results. The catalog import later removed the partial monitor state, but Discord had already reported success.
This change makes a request succeed only after Chaptarr has settled, the exact work and requested format have been selected, every write has survived a read-back, and
BookSearchhas returned a valid acknowledgement.Safe request sequence
RefreshAuthor./edition?bookId=...and its explicitformatas authoritative. Physical editions cannot satisfy audiobook requests./book/monitor, then read both resources back.BookSearchonly after that read-back and require a known successful command acknowledgement before Discord reports success.Partial states are repairable on retry. Available files, grabs, an exact active search, and a recent valid acknowledgement in the same process prevent immediate duplicates—even if an import tail has cleared the monitor flags. After a restart or a completed zero-result search, an explicit retry may intentionally start one fresh search.
This remains a one-work-per-interaction flow. Clear bundle, trilogy, omnibus, box-set, complete-series, and numbered multi-book results fail before any request mutation and tell the user to choose individual titles. Automatic series expansion is a separate feature.
Verification
cargo fmt --all -- --checkpasses.git diff --checkpasses.Exact candidate staging
29476523539passed Nix checks, Clippy, the Docker build, and the exact-image startup smoke test.52ace348has the same Git tree as source commit5683f39.0.9.720.0, then replaced only the Doplarr container.No production-family book request was invented for testing. The PR remains draft until an intentionally chosen new-author request passes the live mutation checklist in
docs/chaptarr/RELEASE_CHECKLIST.md.