fix(import): finalize pending imports without file-filter gate; fail closed on Arr queue errors#330
Draft
cursor[bot] wants to merge 2 commits into
Draft
fix(import): finalize pending imports without file-filter gate; fail closed on Arr queue errors#330cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
…closed on Arr queue errors Regression from f49384b: TryFinalizeImportedTorrentAsync only ran inside Branch 14, which still required IsFileFiltered. Torrents first seen complete (cross-seeds, manual adds) never run Branch 9 file filtering, so Arr-confirmed imports could stall forever with Imported=false and AutoDelete never firing. Also fix IsImportedAsync treating Arr API failures as 'imported', which could prematurely mark DB rows and trigger AutoDelete while the item was still queued. Tests: - ProcessSingleTorrentAsync_PendingImport_FinalizesWithoutFileFilterWhenArrConfirms - IsImportedAsync_QueueCheckFails_ReturnsFalse Co-authored-by: Feramance <Feramance@users.noreply.github.com>
for more information, see https://pre-commit.ci
This was referenced Jul 12, 2026
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
Fixes two regressions introduced in v6.12.4 (
f49384b) when import completion was deferred until Arr queue confirmation.TryFinalizeImportedTorrentAsynconly ran inside Branch 14, which still requiredIsFileFiltered. Torrents first seen in a complete/seeding state (cross-seeds, manual adds) skip Branch 9 file filtering, so Arr-confirmed imports could stall forever withImported=false, tags never applied, andAutoDeletenever firing.IsImportedAsynctreated queue polling failures as "not in queue" and returnedimported=true, which could prematurely mark DB rows and triggerAutoDeletewhile the item was still queued (e.g. during Arr restarts).Testing
Manual test notes:
New tests:
ProcessSingleTorrentAsync_PendingImport_FinalizesWithoutFileFilterWhenArrConfirmsIsImportedAsync_QueueCheckFails_ReturnsFalsedotnet test --filter "Category!=Live"— 781/781 pass (173 Core + 405 Infrastructure + 203 Host).Checklist
dotnet formatandnpm run lint(if touching frontend)Additional Notes
Automated bug-finding scan for commits
e94fab5..949198b. Deduplication: searched open PRs (#322, #329 dep-only), merged PRs (14 days), and open issues (0) — no existing fix found.