fix(debrid): run torbox usenet availibility batch checks in sequence#730
fix(debrid): run torbox usenet availibility batch checks in sequence#730webstreamr wants to merge 1 commit intoViren070:mainfrom
Conversation
WalkthroughRefactored Torbox USENET cached availability checks to replace parallel batch processing with sequential execution, whilst introducing enhanced error propagation and API response validation to improve error diagnostics and control flow clarity. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/core/src/debrid/torbox.ts`:
- Around line 210-218: The thrown DebridError in the instant-availability check
loses its structured metadata when later passed into convertTorBoxError; update
the catch/rehydration logic (the handler that currently calls convertTorBoxError
around the catch at line ~259) to detect DebridError instances and re-throw them
directly (if (err instanceof DebridError) throw err;) instead of converting,
otherwise continue to call convertTorBoxError(err) for non-DebridError errors so
statusCode/statusText/headers remain intact.
🧹 Nitpick comments (1)
packages/core/src/debrid/torbox.ts (1)
220-231: Addtype: 'api_error'for consistency.Other
DebridErrorconstructions in this file includetype: 'api_error'(e.g., lines 144, 287, 327). Consider adding it here for consistency and better error classification.♻️ Proposed fix
if (!Array.isArray(result.data.data)) { throw new DebridError( - 'Invalid response from Torbox API. Expected array, got object', + 'Invalid response from Torbox API. Expected array', { statusCode: result.metadata.status, statusText: result.metadata.statusText, code: 'UNKNOWN', headers: result.metadata.headers, body: result.data, + type: 'api_error', } ); }
|
TorBox increased limits to 300/m which should be enough. Aiostreams should still switch to POST using more hashes, maybe 500 per call in sequence as ST does for torrents. For that TorBox-App/torbox-sdk-js#2 is needed |
first step to avoid 5/s errors in this endpoint. if requests are done in batches because they are more than 100, then they will run in sequence instead of parallel per add-on
Summary by CodeRabbit
Release Notes
Bug Fixes