make a failed import recoverable - #31
Merged
Merged
Conversation
vedhavyas
force-pushed
the
upstream/import-retry
branch
from
August 23, 2026 03:57
3d17902 to
f2312e9
Compare
Retry wrote a queued status the UI has no button for, so the job parked where nothing picked it up. It now resolves the torrent from the hash the job recorded and re-runs the import on the same row, and the button is hidden on a job with no torrent behind it. An import claims its download by hash for the duration, so a retry cannot race the watcher or a manual organize over the same files. The monitor's retry_job action moves to approval, since an import moves files into the vault.
Picks up the manager_test fix from JeremiahM37#30: the import writes the completed status before it tracks the library item, so waiting on that status and asserting the library row in the same breath races. It is what made the test job red here on a slow runner.
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.
qBittorrent does not always have the finished files at the path it reports by the time the watcher fires, so an import can fail on a path that appears a moment later and the job then sits at error with nothing retrying it. This retries on a bounded schedule, and once the budget is spent it leaves a row saying the download is still in the client so it can be organized by hand.
The Retry button now re-runs that import. It previously wrote a queued status nothing consumes, so the job read as permanently active and the click did nothing.
The scan-and-organize step is now in one place rather than duplicated across callers.