An episode whose file turns out to be a torrent is never marked downloaded, and is fetched again every scan #155

Closed
opened 2026-10-08 18:36:22 -07:00 by rays · 1 comment
Owner

Found in a code audit on 2026-10-09.

When an enclosure advertised as audio turns out, once downloaded, to be a .torrent file, fetch_one (src/main.rs:1990-1999) hands it to torrent_one and returns what that returns, without mark_downloaded. In a scan nobody else records it either (scan_one relies on fetch_one to have), so the enclosure stays pending: the page never shows it downloaded, and every scan of the feed downloads the .torrent again and runs the torrent again, inline on the worker, where it can take the stall limit and then seed up to seed_time_mins (30 and 60 minutes in production), with no other feed checked meanwhile.

Torrents are on in production ([torrent] enabled = true). An enclosure advertised as a torrent goes the other way, detached and recorded (spawn_torrent), and ipx download records it after the fact, so only a scan hits this.

Found in a code audit on 2026-10-09. When an enclosure advertised as audio turns out, once downloaded, to be a `.torrent` file, `fetch_one` (`src/main.rs:1990-1999`) hands it to `torrent_one` and returns what that returns, without `mark_downloaded`. In a scan nobody else records it either (`scan_one` relies on `fetch_one` to have), so the enclosure stays `pending`: the page never shows it downloaded, and every scan of the feed downloads the .torrent again and runs the torrent again, inline on the worker, where it can take the stall limit and then seed up to `seed_time_mins` (30 and 60 minutes in production), with no other feed checked meanwhile. Torrents are on in production (`[torrent] enabled = true`). An enclosure advertised as a torrent goes the other way, detached and recorded (`spawn_torrent`), and `ipx download` records it after the fact, so only a scan hits this.
rays added the bug label 2026-10-08 18:36:22 -07:00
Author
Owner

Fixed in ec55682: a download that turns out to be a torrent goes the way an advertised one does: in the daemon, marked downloading and handed to spawn_torrent, which records it when done; in a one-off CLI run, run and recorded there. Deployed as 0.10.3-dev on 2026-10-09.

Fixed in ec55682: a download that turns out to be a torrent goes the way an advertised one does: in the daemon, marked downloading and handed to spawn_torrent, which records it when done; in a one-off CLI run, run and recorded there. Deployed as 0.10.3-dev on 2026-10-09.
rays closed this issue 2026-10-08 18:58:43 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#155