Skip to content

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
masterfrom
cursor/bug-finding-automation-2303
Draft

fix(import): finalize pending imports without file-filter gate; fail closed on Arr queue errors#330
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/bug-finding-automation-2303

Conversation

@cursor

@cursor cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes two regressions introduced in v6.12.4 (f49384b) when import completion was deferred until Arr queue confirmation.

  1. Finalize stall for complete-first torrentsTryFinalizeImportedTorrentAsync only ran inside Branch 14, which still required IsFileFiltered. Torrents first seen in a complete/seeding state (cross-seeds, manual adds) skip Branch 9 file filtering, so Arr-confirmed imports could stall forever with Imported=false, tags never applied, and AutoDelete never firing.
  2. Fail-open on Arr API errorsIsImportedAsync treated queue polling failures as "not in queue" and returned imported=true, which could prematurely mark DB rows and trigger AutoDelete while the item was still queued (e.g. during Arr restarts).

Testing

  • Added or updated automated tests
  • Performed manual verification (describe below)
  • Not applicable (explain why)

Manual test notes:

N/A — covered by unit tests.

New tests:

  • ProcessSingleTorrentAsync_PendingImport_FinalizesWithoutFileFilterWhenArrConfirms
  • IsImportedAsync_QueueCheckFails_ReturnsFalse

dotnet test --filter "Category!=Live" — 781/781 pass (173 Core + 405 Infrastructure + 203 Host).

Checklist

  • Linked the related issue or discussed scope with maintainers
  • Ran dotnet format and npm run lint (if touching frontend)
  • Updated documentation or release notes where it makes sense
  • Confirmed there are no sensitive secrets or credentials committed

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.

Open in Web View Automation 

cursoragent and others added 2 commits July 9, 2026 10:14
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant