Skip to content

Guard completed-download book override to local DB books only - #2

Merged
EdLaughton merged 1 commit into
developfrom
claude/import-match-threshold-setting-GefjL
Mar 16, 2026
Merged

EdLaughton merged 1 commit into
developfrom
claude/import-match-threshold-setting-GefjL

Conversation

@EdLaughton

Copy link
Copy Markdown
Owner

The RemoteBook-context work (147a11e) set IdentificationOverrides.Book from remoteBook.Books when there was exactly one book. CandidateService treats a Book override as authoritative and calls GetDbCandidatesByBook, which requires a valid local DB book ID. If the Book object is stale or unmapped, candidate resolution collapses to zero and import silently fails.

Fix:

  • In CompletedDownloadService and DownloadedBooksCommandService, only set overrides.Book when the candidate has Id > 0 and is confirmed to exist in the local database via IBookService.GetBook().
  • In CandidateService, if a Book override produces zero candidates, fall back to author-scoped search instead of dead-ending.

This preserves the improved matching when a valid local book is available while preventing import failures from invalid book overrides.

https://claude.ai/code/session_01976eMqb4mwazHh13NZkDY5

The RemoteBook-context work (147a11e) set IdentificationOverrides.Book
from remoteBook.Books when there was exactly one book. CandidateService
treats a Book override as authoritative and calls GetDbCandidatesByBook,
which requires a valid local DB book ID. If the Book object is stale or
unmapped, candidate resolution collapses to zero and import silently
fails.

Fix:
- In CompletedDownloadService and DownloadedBooksCommandService, only
  set overrides.Book when the candidate has Id > 0 and is confirmed to
  exist in the local database via IBookService.GetBook().
- In CandidateService, if a Book override produces zero candidates, fall
  back to author-scoped search instead of dead-ending.

This preserves the improved matching when a valid local book is available
while preventing import failures from invalid book overrides.

https://claude.ai/code/session_01976eMqb4mwazHh13NZkDY5
@EdLaughton
EdLaughton merged commit c886ede into develop Mar 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants