soulsync/core/downloads
BoulderBadgeDad 56bdcee434 Fix: rejected slskd download hung the task at 'downloading' forever (#836)
A wishlist track (or tracks in an album) that slskd accepted then REJECTED would
sit at "DOWNLOADING... 0%" indefinitely, spam an ERROR every status poll
("…Completed, Rejected - letting monitor handle retry"), and — for albums —
block the whole batch from ever completing.

Root defect: the status formatter's non-manual error branch keeps the task
'downloading' and trusts the retry monitor to resolve it, with NO backstop. When
the monitor can't make progress (a rejected transfer with no other source), the
task is stuck forever.

Backstop: measure how long the ERROR state has persisted (keyed off the task's
last status transition, so a slow-but-healthy transfer is never failed, and each
monitor-retry episode gets a fresh window). Once it exceeds the monitor's retry
window (60s, vs the monitor's ~15s) with no resolution, mark the task failed and
fire the worker-freeing completion callback so the batch can finish. Also log the
error ONCE per episode instead of every 2s poll. The healthy path is untouched —
a working retry transitions the task before the grace, so this never fires.
Manual picks still fail immediately (unchanged).

Tests: rejected-within-grace stays downloading; rejected-beyond-grace fails +
schedules completion; manual pick fails immediately. 45 status tests pass.
2026-06-10 18:16:22 -07:00
..
__init__.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
album_bundle_dispatch.py Album bundle: fall back to per-track on an I/O error, don't hard-fail the batch 2026-06-01 13:29:05 -07:00
cancel.py diag: log every cancel_download caller with a trigger label 2026-05-19 22:31:29 -07:00
candidates.py #797: stop AcoustID quarantining correct non-English-artist downloads 2026-06-05 16:02:01 -07:00
cleanup.py PR4c: lift _automatic_wishlist_cleanup_after_db_update to core/downloads/cleanup.py 2026-04-27 22:23:41 -07:00
file_finder.py Fix: a '/' in a song title was treated as a path separator (#835) 2026-06-10 16:29:09 -07:00
history.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
lifecycle.py Album-bundle staging: clean Soulseek copies + sweep orphans at startup 2026-05-27 22:18:42 -07:00
master.py Wishlist: serialize album-bundle downloads so they stop flooding the search pool (Sokhi #740) 2026-06-09 10:06:53 -07:00
monitor.py Downloads: cached-first quarantine retry — stop re-searching the same source 2026-06-06 16:44:14 +02:00
origin.py Download Origins: see (and delete) exactly what watchlist + playlist syncs downloaded 2026-06-07 00:15:31 -07:00
playlist_folder.py Fix #780: Deezer/non-Spotify organize-by-playlist resolved the wrong row 2026-06-03 20:41:04 -07:00
post_processing.py Add torrent and usenet release staging support 2026-05-21 14:22:21 -07:00
staging.py Staging match: log rejection reason on every silent-False exit 2026-05-27 14:12:55 -07:00
status.py Fix: rejected slskd download hung the task at 'downloading' forever (#836) 2026-06-10 18:16:22 -07:00
task_worker.py Post-merge #801 follow-ups: un-silence the retry engine's logs + register origin-history.js 2026-06-07 00:58:09 -07:00
track_detail.py Downloads: add per-track detail endpoint for the track-detail modal 2026-05-31 20:18:35 -07:00
track_link.py Manual download search: paste a Tidal/Qobuz track link to grab the exact version (#813) 2026-06-08 15:03:54 -07:00
track_metadata_backfill.py Wishlist: harden Spotify backfill — poisoned tn=1 can't mask lean album 2026-05-27 16:47:26 -07:00
validation.py Add torrent and usenet release staging support 2026-05-21 14:22:21 -07:00
wishlist_aggregator.py Wishlist modal: surface most-advanced live phase, not least-complete 2026-05-26 22:35:53 -07:00
wishlist_failed.py Fix album-bundle staging match + wishlist provenance (#700, #698) 2026-05-26 07:12:49 -07:00