omi icon indicating copy to clipboard operation
omi copied to clipboard

Dropbox: restore bounded retries when file downloads hit transient transport errors

Open kaijakagi-sys opened this issue 2 months ago • 1 comments

Problem

The Dropbox plugin's download_file method declares up to three attempts for requests.exceptions.Timeout and ConnectionError, but its inner except Exception converts the first transport exception to (None, error). Tenacity therefore sees a successful return and never retries.

Source: download_file. The user-facing file-read tool turns that result into Could not download file, even when a second request could succeed. I have not reproduced an affected user's live Dropbox session.

Offline, I exercised the unchanged client with the real Tenacity 9.1.4 decorator and a stubbed HTTP transport/exception types. A synthetic timeout followed by a queued successful response made only one request and returned an error; the connection-error case did the same. Immediate HTTP 200 and HTTP 409 controls each made one request. A separate decorator control retried the escaping timeout and succeeded on attempt two. These five observations demonstrate the exception-boundary problem; they are not a tested fix or live Dropbox tests.

Proposed bounded fix

Restore the existing three-attempt transport-retry contract for downloads only, while preserving the public (bytes, error) result on exhausted retries. Keep immediate success and non-retryable HTTP responses unchanged. Do not change authentication, file conversion, upload/folder creation, or retry writes: upload replay and autorename semantics need separate consideration.

Add hermetic tests that execute production download behavior with a controlled transport: Timeout→success, ConnectionError→success, exhaustion after three attempts, immediate success, and non-retryable HTTP error. Wire them into the existing appropriate CI/component test lane, not an undiscovered standalone script. Run the required contribution checks and clearly distinguish offline tests from live user-path verification.

Scope and bounty question

I checked the current Dropbox/retry issue and PR results, including the actual patches for #8599 and #4864; neither repairs this client method. Is this download-only scope useful and not already assigned? @josancamon19, would you consider a $25 bounty for a merged fix with those regressions under the contribution guide's suggested-bounty process? Scope, eligibility and reward are unconfirmed; I am proposing before implementation.

kaijakagi-sys avatar Sep 08 '26 17:09 kaijakagi-sys

/claim #13171

Submitted fix and unit tests in PR #13331.

CreamPle avatar Sep 09 '26 17:09 CreamPle