Repository navigation
Let download repair accept a library switched from hardlink to copy - #90
Open
TheMightyTRex wants to merge 1 commit into
Open
TheMightyTRex wants to merge 1 commit into
TheMightyTRex wants to merge 1 commit into
Conversation
After an administrator changed a library's import method from hardlink to copy, held downloads could not be repaired: connection repair compared the whole frozen destination with the current one, so the changed mode failed with "The library destination changed; this repair cannot move an existing import", although the library location had not moved. Repair now compares the destination without the mode and accepts the mode when it is unchanged or is now copy. Copying moves nothing for a download that has not been imported yet. Any other destination change, or a switch from copy to hardlink, still needs a new selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
When a library's import method is changed from hardlink to copy (for example because hardlinks do not work for those folders), downloads that were already submitted and are held for connection repair cannot be repaired. The repair stops with "The library destination changed; this repair cannot move an existing import", although the library location has not moved.
Connection repair compared the whole frozen destination with the current one, including the import mode, so any mode change was treated as a moved destination.
Change
services/app/domain/download_repairs.pygainssame_destination, which compares the destination without the mode and accepts the mode when it is unchanged or is now copy. The repair proposal uses it in place of the exact comparison.Copying moves nothing for a download that has not been imported yet, and copy works where hardlinks do not. Every other destination change, and a switch from copy to hardlink, still stops the repair as before.
Testing
tests/unit/test_download_repair_destination.py: switching to copy and a new backend credential generation keep the destination; copy to hardlink, a different root or a different backend do not.tests/integration/test_download_repairs.py: the existing resume test is now also run with a library switched from hardlink to copy, and the held transfer resumes.tests/unit/test_download_repair_destination.py,tests/integration/test_download_repairs.pyandtests/integration/test_download_attempts.py: 61 passed.ruff checkandruff format --checkpass.🤖 Generated with Claude Code