fix(metadata): treat Audible's empty product stub as no answer so the provider chain can continue#762
Draft
kevinheneveld wants to merge 1 commit into
Draft
Conversation
… provider chain can continue
An ASIN missing from Audible's catalog resolves to a non-null but EMPTY
AudibleBookResponse (no title, no fields — the catalog API returns a
product node with every attribute null). The provider loop took that
shell as a successful answer: the caller received junk metadata
('source: Audible' with nothing in it) and every later source in the
chain (Audnexus, anything added in future) was silently skipped.
Live case: an Amazon-exclusive edition whose ASIN returns the empty
stub from all ten regional Audible catalogs — 'fill missing from
online' reported success while filling nothing. A titleless response
is now treated as no answer and the chain falls through.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The bug
An ASIN that's missing from Audible's catalog doesn't 404 — the catalog API returns a product node with every attribute null, which
GetBookMetadataAsyncmaps into a non-null but completely emptyAudibleBookResponse.AudiobookMetadataService.GetMetadataAsync's provider loop only checksresult != null, so the empty shell counted as a win:source: Audible, all fields null) — "fill missing from online" reports success while filling nothing;Live case that surfaced it: an Amazon-exclusive audiobook edition whose ASIN returns the empty stub from all ten regional Audible catalog APIs.
The fix
A titleless
AudibleBookResponseis treated as no answer (logged) and the loop falls through to the next configured source. One conditional; no behavior change for any ASIN Audible actually carries.Testing
Full suite: 1189 passed. Verified live on my instance: the previously-junk ASIN now falls through the chain instead of short-circuiting with an empty payload.
🤖 Generated with Claude Code