2 months ago
f1afa6eTwo remote-library HTTP robustness fixes in src-tauri. #204 — streaming playback range fetcher had no timeouts: ProviderFetcher and ReqwestFetcher were built with `reqwest::blocking::Client::new()` (no connect/read timeout), so a half-open/stalled connection parked the fetch thread forever and defeated the retry/reconnect safety net. Build both clients with an explicit connect timeout and a per-request timeout, and consume the range body with a streaming `read()` loop so reqwest's blocking `Read` applies that timeout as a per-read idle timeout: a stall now trips a bounded `FetchError::Io` (feeding fetch_range_with_retry → ConsecutiveFailures → reconnect and letting the fetch thread exit), while a slow-but-steady weak link keeps making progress. #205 — downloads buffered the whole file/chunk with response.bytes(): Both `download_file` and 8 MiB-chunk `download_range` across WebDAV, Dropbox, and Google Drive read the entire body under one total-body deadline, so 2G-class links timed out with zero durable progress and every interruption discarded up to 8 MiB. Add `net_policy::stream_response_body` (a per-read idle-timeout streaming loop with a wall-clock budget) and route all six paths through it, writing bytes to the destination/part file as they arrive. The resumable driver now persists the actual on-disk length on a mid-chunk failure and clamps the resume point to it, so interruptions resume sub-chunk instead of re-downloading the whole chunk; the final size/digest validation is unchanged. Tests: streaming trickle-succeeds / stall-times-out-with-partial-write and oversize-cap (net_policy); ProviderFetcher stall returns a bounded error and a timed-out fetch drives ConsecutiveFailures + clean thread join (remote_source); sub-chunk resume completes with a verified digest (atomic_download); full-body streaming through the WebDAV provider path. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Parentc5dfec9