fix: block debrid adds that would just sit stuck at zero seeders - #111
Merged
Merged
Conversation
A zero-seed torrent that isn't already cached in the debrid provider never finishes: it just occupies one of the account's few concurrent slots forever (TorBox's own stall detection only fires after a multi-minute timeout, by which point the slot is already gone). On a plan capped at a handful of concurrent downloads, a few of these permanently blocks every future add. Seeders and cache status are already known before the user clicks add on both front ends, so a shared guard (src/util/debridAddGuard.ts) now refuses the add outright instead of letting it get stuck. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147i7Q9sRkmaCfjpBjuBQaN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/util/debridAddGuard.ts) that both front ends already have the data for (seeders, per-source health, and cache status all known before the click) and refuses the add outright with an explanatory notice instead of letting it get stuck./api/addroute is unchanged, since the actual bug is the button click, not scripted API use.seeders: 0meaning "unknown", perresultFilter.ts's existing convention) is never blocked, and an already-cached result is never blocked regardless of seeders.Test plan
npm test— full suite (3348 tests) passes, including newaddPlancases for blocked/cached/unhealthy-source/P2P-exemptnpm run typechecknpm run lint(only the pre-existingreact-hooks/exhaustive-depswarning)npm run build🤖 Generated with Claude Code
https://claude.ai/code/session_0147i7Q9sRkmaCfjpBjuBQaN