A 429 from the Audible API reads as "no metadata" to every caller

Đang mở
#960 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with MetadataRegistrationExtensions.cs and AudibleApiClient.cs to trace how HTTP failures and status codes are handled; then inspect the cited callers in the rescan, ASIN lookup, and title-search workflows. Compare TorrentFileDownloader.cs:183-195 for the existing Retry-After approach. Done when a throttled Audible response is distinguishable from missing metadata and can be retried or deferred without changing the separate rescan cooldown behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

p2

All line references are at a630572e.

What a user sees

A book that exists on Audible comes back "No metadata found using the available identifiers." from a rescan, and the same ASIN works a minute later. It shows up during a burst of lookups rather than on a single one. The only trace is one warning line from the HTTP client naming the status code. Nothing downstream says the provider throttled us, so the symptom is identical to a book that has no catalog entry at all.

The code path

AudibleService gets its typed HttpClient with a Polly policy built from HandleTransientHttpError (listenarr.infrastructure/DependencyInjection/Metadata/MetadataRegistrationExtensions.cs:25-29). That extension covers HttpRequestException, 5xx and 408, not 429, so a throttled request is never retried.

That same client is handed to AudibleApiClient (listenarr.application/Metadata/Audible/AudibleService.cs:44), where any non-success status logs a warning and returns null (AudibleApiClient.cs:83-87), so the status code stops there.

Callers then read null as absence:

  • LibraryMetadataRescanWorkflow.cs:169 calls GetMetadataAsync; null becomes a 404 carrying that message at :289-291.
  • AsinLookupService.cs:115-118 turns null straight into the string "Metadata not found".
  • SearchByTitleWorkflow.cs:103-109 logs "returned null" and falls through to intelligent search.

Why it matters

AudibleService.cs:177-182 fetches metadata per candidate in a loop, and the refresh and monitoring paths sweep many books in one pass, so bursts are routine. Under throttling a whole sweep reports nothing found.

Worth keeping apart from this: the rescan endpoint emits a 429 of its own, a per-actor 15 second cooldown with a Retry-After (LibraryMetadataRescanWorkflow.cs:27, :85 and :92-99), a different mechanism sharing a status code.

What I think the fix looks like

Surface the status instead of flattening it: an exception, or a typed result carrying the status code, so callers can defer rather than record an absence. Then let the policy handle 429 with a Retry-After-aware delay. TorrentFileDownloader.cs:183-195 already does that in this repo and could be the shape to copy.

Before anyone sends a PR: typed result or exception? AudibleApiClient sits in the area #635 proposes reworking, so I would rather not pick for you. Related but distinct: #638 covers 429 on the indexer side.

This is from reading the source. I have not reproduced it against the live Audible API.

Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting.

Ngôn ngữ chính
C#
Star
901
Fork
70
Merge trung bình
16 giờ 27 phút
Pull request đã merge (30 ngày)
60

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Listenarrs/Listenarr

Tất cả issue của Listenarrs/Listenarr

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.