Thanks to visit codestin.com
Credit goes to github.com

Skip to content

protondrive: fall back to decrypted-name search when the name-hash lookup misses - #9851

Open
SillyZir wants to merge 1 commit into
rclone:masterfrom
SillyZir:fix-protondrive-name-fallback
Open

SillyZir wants to merge 1 commit into
rclone:masterfrom
SillyZir:fix-protondrive-name-fallback

Conversation

@SillyZir

@SillyZir SillyZir commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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 SearchByNameInActiveFolderByID matches 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. getObjectLink and FindLeaf both 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_all for 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

  • This change is trivial OR it has been discussed and agreed in the linked issue.
  • I have read the contribution guidelines.
  • (If I used AI tools to help write this code) I have read and understood the AI-assisted contributions guidance, and I have tested and take ownership of this change myself.
  • I have added tests for all changes in this PR if appropriate. (The fallback needs a live Proton remote to exercise; no protondrive unit-test harness exists in-tree.)
  • I have added documentation for the changes if appropriate. (Behavior fix, no user-facing option changes.)
  • All commit messages are in house style.
  • (Backend changes only) test_all passes for this backend — see note above.
  • This Pull Request is ready for review.

…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
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.

protondrive: folders/files created by new Proton Drive 3.x clients (new SDK) are unresolvable — wrong name hash format + unusable content session key

1 participant