Files
jakeaturner a6f18b05ab fix(downloads): mark terminal failures correctly when retries are skipped
The worker's failed handler decided a failure was final by comparing
attemptsMade to opts.attempts. An UnrecoverableError (disk full, gated
auth) skips BullMQ's retries and fails on attempt 1 of 10, so that check
never fired. A Wikipedia download that hit a full disk stayed at
"downloading", and failed auto-updates never advanced their backoff.

Use job.finishedOn instead. BullMQ sets it only when a job moves to the
failed set for good.

User cancels also throw UnrecoverableError, so they now count as
terminal. Exclude them from the auto-update backoff with a shared
RunDownloadJob.CANCELLED_PREFIX, so a cancel can't self-disable an
update.
2026-11-17 22:18:29 +00:00
..