Skip to content

fix(downloads): treat transient network and rate-limit errors as transient - #301

Merged
fraa2a merged 3 commits into
mainfrom
fix/download-transient-errors
Nov 6, 2026
Merged

fraa2a merged 3 commits into
mainfrom
fix/download-transient-errors

Conversation

@fraa2a

@fraa2a fraa2a commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What changed?

Three download pipeline fixes from the review, one commit each:

  • H5, link check cache: transient failures (network errors, timeouts, HTTP 408/425/429/5xx, rate limits) are no longer cached for 24h; dead links (404, 403, web page) still are. The link lookup timeout in inspect is now a Network error. New ResolveError::is_transient().
  • H4, GoFile network errors: GoFile transport failures (API request, body read, website-token fetch, final HEAD, 120s resolution timeout) now map to ResolveError::Network, so going offline keeps the partial file instead of treating it as a broken link. GofileError gains a Network variant.
  • Hoster wait/rate-limit retries: new ResolveError::RateLimited { message, retry_after } for 1fichier wait notices, Buzzheavier 429 and browser checks, GoFile rate limits and generic 429. The mirror retry loop now sleeps the stated wait (default 30s, clamped 1s to 300s, cancellable) instead of 250 ms. A rate-limited retry still counts toward the mirror's 4 attempts.

download_queue.rs is touched minimally (new TransferError::RateLimited, one From arm, the retry delay, a Display arm). It may conflict lightly with the queue scheduling PR.

Validation

  • cargo test 965 passed, 0 failed; cargo clippy --all-targets -D warnings and cargo fmt --check clean.
  • New tests: transient_failures_are_not_cacheable, network_failures_stay_network_errors, rate_limit_delay_respects_the_host_within_bounds, plus 1fichier wait-notice assertions.
  • Manual test offline / with a rate-limited hoster.
  • No unrelated changes.

Generated by Claude Code

Offline, timeouts, HTTP 429 and 5xx no longer poison the 24 hour link
cache; genuine dead links are still cached.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
GoFile transport errors were reported as link errors, so going offline
discarded the partial file. They now map to ResolveError::Network and
keep the partial download.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
1fichier waits, Buzzheavier and GoFile rate limits and HTTP 429 now carry
the host's Retry-After (bounded) and the mirror retry loop sleeps that
long instead of 250 ms, so a resumable download is not burned in a second.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
@fraa2a
fraa2a merged commit f2042eb into main Nov 6, 2026
7 checks passed
@fraa2a
fraa2a deleted the fix/download-transient-errors branch November 6, 2026 16:08
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