fix: reopen the gap for a grab whose torrent vanished #98

Merged
naps62-yolo merged 1 commits from issue/86-vanished-torrent into main 2026-08-23 02:31:52 +01:00
Owner

Closes #86.

A grab in sent or downloaded state whose infohash Transmission no longer reports (removed by hand) is now marked vanished — a state distinct from failed so it does not feed the needs_decision attention queue — and the movie, episode, or season it targets reopens as a gap. Nothing is blacklisted, since the release itself never failed policy.

Reclaiming the gap means the same release can legitimately be grabbed again, which collides with the old dead row on grabs.infohash's uniqueness constraint. The insert in send_winner now upserts over a vanished row instead of only over sent/downloaded (the restart case), so a re-grab reclaims the row rather than silently losing state.

crates/arr-daemon/src/grab.rs's reopen_target is shared by both grab.rs (a sent grab vanishing before it ever downloaded) and import.rs (a downloaded grab vanishing before import).

Migration 0011 adds vanished to the grabs.state CHECK constraint.

Closes #86. A grab in `sent` or `downloaded` state whose infohash Transmission no longer reports (removed by hand) is now marked `vanished` — a state distinct from `failed` so it does not feed the `needs_decision` attention queue — and the movie, episode, or season it targets reopens as a gap. Nothing is blacklisted, since the release itself never failed policy. Reclaiming the gap means the same release can legitimately be grabbed again, which collides with the old dead row on `grabs.infohash`'s uniqueness constraint. The insert in `send_winner` now upserts over a `vanished` row instead of only over `sent`/`downloaded` (the restart case), so a re-grab reclaims the row rather than silently losing state. `crates/arr-daemon/src/grab.rs`'s `reopen_target` is shared by both `grab.rs` (a `sent` grab vanishing before it ever downloaded) and `import.rs` (a `downloaded` grab vanishing before import). Migration 0011 adds `vanished` to the `grabs.state` CHECK constraint.
naps62-yolo added 1 commit 2026-08-23 02:17:05 +01:00
fix: reopen the gap for a grab whose torrent vanished
ci / web (pull_request) Successful in 2m1s
e2e / e2e (pull_request) Successful in 3m34s
ci / rust (pull_request) Successful in 8m37s
b7112c7568
A grab in sent or downloaded state whose infohash Transmission no
longer reports (removed by hand) is marked `vanished`, a state
distinct from `failed` so it does not feed the needs_decision
attention queue, and the movie/episode/season it targets reopens as
a gap. Nothing is blacklisted, since the release itself never failed
policy. Re-grabbing the same infohash afterwards reclaims the dead
row instead of losing the grab to the infohash uniqueness constraint.

Closes #86
naps62-yolo merged commit bc2da22ea5 into main 2026-08-23 02:31:52 +01:00
naps62-yolo deleted branch issue/86-vanished-torrent 2026-08-23 02:31:53 +01:00
Sign in to join this conversation.