Files
zpan/server
saltbo 75761b3764 fix(downloads): settle control tasks for already-offline downloaders too
The previous fix gated control-task settling on listStaleIds, which only
returns downloaders that are still status='online' with a stale heartbeat — the
online→offline transition. A downloader marked offline by an earlier sweep is
never returned again, so a canceling/pausing task it held stayed stuck forever
(exactly the observed case). The early 'no new stale downloaders' return made it
worse.

Add listUnreachableIds (heartbeat past the lease, any status) and settle
canceling→canceled / pausing→paused for those every sweep (idempotent),
independent of the requeue+markOffline transition path.

Regression test now flips the downloader to status='offline' before recovery —
the case the prior fix missed.
2026-06-19 12:39:59 -04:00
..