backend/protondrive: fix shouldRetry to enable pacer retry logic #9080
+67
−1
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.
Summary
Implement
shouldRetry, replacing an alwaysfalsestubProblem
The
shouldRetryfunction was a stub returningfalseunconditionally, preventing the pacer from retrying transient errors. Users see failures like:422 POST .../storage/blocks: Operation failed: Please retry (Code=200501)These should be automatically retried but aren't.
See also:
https://forum.rclone.org/t/rclone-uploads-failing-to-proton-drive/52545
Changes
shouldRetryfollowing pattern from other backends (box, dropbox)fserrors.ContextErrorfserrors.ShouldRetryfor network-level errorsTest plan
golangci-lintpassesgo buildandgo testpassManual test results
Tested with real Proton Drive account. The fix correctly detects and retries Code=200501 errors:
Note: Uploads still fail due to a separate orphaned draft issue (Code=2500/2501) in the upstream Proton-API-Bridge library. This is a known limitation tracked at henrybear327/Proton-API-Bridge#16 and requires ClientUID support to resolve. The
shouldRetryfix in this PR works as intended.Notes
Reviewed
shouldRetryimplementations across other backends (swift, dropbox, ftp, putio, filescom, box). This implementation follows the established pattern: context check first, backend-specific error detection, then fallback tofserrors.ShouldRetry. String-based error matching mirrors dropbox's approach, which is appropriate when the underlying SDK doesn't expose typed errors.