Conversation
…okup misses Links created by newer Proton Drive clients carry a name hash in a different format, so the API-side search by legacy hash never matches and rclone reports files that exist as not found. When the hash search returns nothing, list the folder and compare the decrypted names. See rclone#9622
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.
What does this change do?
Files and folders created by newer Proton Drive clients (3.x) could not be found by rclone: the API-side
SearchByNameInActiveFolderByIDmatches children by their legacy name hash, and links written by new clients carry a hash in a different format which never matches, so lookups returned not-found for entries that clearly exist.This adds a fallback: when the hash search misses, list the folder and compare the decrypted names directly.
getObjectLinkandFindLeafboth go through the new helper, so object lookup and directory traversal are covered. Entries created by old clients resolve exactly as before (the fallback only runs when the hash search returns nothing).Deliberately not addressed here — input wanted: #9622 also reports that uploading a new revision to files created by new clients fails, because their content session key decrypts but can't be used for encryption ("bad key length" from gopenpgp). I considered trashing the old link on that error and recreating the file with a fresh key, but that silently destroys the file's revision history, and detecting the condition means string-matching the error — both felt like decisions the maintainers should make. Options I can see: (a) trash-and-recreate (loses revisions, transparent to the user), (b) surface a clearer actionable error telling the user to re-upload, (c) fix key handling upstream in the Proton API library. Happy to implement whichever direction you prefer in a follow-up.
Linked issue
Fixes #9622
For new or changed backends
I could not run
test_allfor protondrive — I don't have a Proton test account.go build/go vet/ the package tests pass locally. Happy to work through integration issues if the daily tester flags anything.Checklist
test_allpasses for this backend — see note above.