Skip to content

protondrive: align move crypto and revision fallback with the SDK#4

Open
tdawe1 wants to merge 3 commits intorclone:masterfrom
tdawe1:fix/protondrive-sdk-flow-rclone
Open

protondrive: align move crypto and revision fallback with the SDK#4
tdawe1 wants to merge 3 commits intorclone:masterfrom
tdawe1:fix/protondrive-sdk-flow-rclone

Conversation

@tdawe1
Copy link

@tdawe1 tdawe1 commented Mar 14, 2026

Support the rclone Proton Drive backend update by aligning the bridge move/upload compatibility behavior with the current Proton Drive SDK.

The main issue here was that move-related flows no longer matched the newer SDK behavior closely enough. In practice, that meant moves could fail or leave moved folders containing files in a bad state.

This change updates the bridge to:

  • preserve the original node passphrase session key when re-encrypting moved folders, matching the current SDK behavior
  • send optional move signature fields only when the SDK would send them
  • fall back cleanly from newer volume-based compatibility helpers to the older share-based helpers when the preferred method exists but has an incompatible transitional signature
  • tolerate missing revision-verification helpers in the compatibility layer so the supported v2 path can still work without reviving deprecated API behavior

Testing:

go test ./... -run '^(TestReencryptKeyPacketPreservesSessionKey|TestSetMoveLinkSignatureAddressCompat|TestApplyMoveRequestSignaturesForSignedNode|TestApplyMoveRequestSignaturesForAnonymousNode|TestBuildVerificationTokenXorsWithEncryptedBlock|TestBuildVerificationTokenKeepsTailWhenBlockShorter|TestGetRevisionVerificationCompatPrefersVolumeRoute|TestGetRevisionVerificationCompatFallsBackToShareRoute|TestGetRevisionVerificationCompatFallsBackWhenVolumeRouteSignatureIsIncompatible|TestGetRevisionVerificationCompatHandlesInvalidSignature|TestGetRevisionVerificationCompatHandlesPanickingMethod|TestGetRevisionVerificationCompatAllowsMissingMethods|TestMoveLinkCompatPrefersVolumeRoute|TestMoveLinkCompatFallsBackToShareRoute|TestMoveLinkCompatFallsBackWhenVolumeRouteSignatureIsIncompatible|TestMoveLinkCompatHandlesInvalidSignature|TestMoveLinkCompatHandlesPanickingMethod|TestUploadBlockWithClientDelegatesSingleCall)$' -count=1

GOWORK=/tmp/proton-sdk-work/go.work \
PROTON_API_BRIDGE_APP_VERSION='web-drive@5.2.0+af66c8fa' \
PROTON_API_BRIDGE_DRIVE_SDK_VERSION='js@5.2.0+af66c8fa' \
go test ./... -run '^(TestCreateAndMoveAndDeleteFolder|TestCreateAndMoveAndDeleteFolderWithAFile|TestCreateAndMoveAndDeleteAFileOneLevelFromRoot)$' -count=1 -v

This PR should be reviewed on top of the companion go-proton-api SDK base compatibility PR.

Companion SDK base PR: rclone/go-proton-api#5

tdawe1 added 3 commits March 8, 2026 00:54
Update the bridge to match SDK-era ProtonDrive request shapes and request headers while keeping mixed-version compatibility.

This removes the duplicate outer upload retry loop, centralizes manager retry configuration, improves draft-conflict recovery, and adds focused tests for compatibility, upload delegation, and manager retry behavior.
Preserve passphrase session keys during moves and only send optional move signatures when the SDK would. Also tolerate missing revision-verification helpers so the bridge can follow the supported v2 path without reviving deprecated API behavior.
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