Repository navigation
fix(syncer): retain Dropbox checkpoints on download failure - #21809
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Batch checkpoint and retry behavior internal/syncer/connector/dropbox.go, internal/syncer/connector/dropbox_test.go |
NextBatch now returns an error naming a failed file and leaves the session index uncommitted. Empty downloads remain skipped. Tests cover retrying the session and reopening from the last committed checkpoint. |
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: haruko386
Merge Risk: 
Minimal · previous review 261ff
-
Failed Dropbox downloads remain retryable. No merge-blocking risk was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the failure mode, implementation, retry behavior, tradeoff, affected modules, linked issue, tests, and known validation limits. It uses a "### Description" heading instead of the template's "### Summary" heading, but it provides the required summary information and is otherwise complete.
Full details: Linked Issues check
-
Explanation
Issue
#21808requires Dropbox download failures to avoid acknowledging an incomplete batch and to replay the failed file with preceding uncommitted files. IndropboxSyncSession.NextBatch, the change usesnextIndex, returns a wrapped error with an emptySyncBatchon download failure, and assignss.indexonly after all downloads succeed. The regression test covers batch sizes 1 and 2, same-session retry, reopening from the last checkpoint, and successful zero-byte behavior remains skipped. The changed files are limited to the Dropbox connector and its tests.
Full details: Out of Scope Changes check
-
Explanation
The pull request changes only
internal/syncer/connector/dropbox.goandinternal/syncer/connector/dropbox_test.go. The implementation and tests directly support issue#21808checkpoint and retry behavior. No WebDAV changes, timestamp-selection changes, public API changes, schema changes, or unrelated behavior are present in the reviewed diff.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit watched the batch proceed,
Then paused when one file failed to feed.
No checkpoint leapt ahead,
The retry found what had not read,
And every file resumed its speed.
Harsh23Kashyap
left a comment
There was a problem hiding this comment.
Approving at 261ffc3, the same commit I verified this morning from a clean checkout (details on #21808): both regression subcases fail on current main - with b.txt returning 503, NextBatch emits a.txt, writes a checkpoint for b.txt, and returns a nil error - and pass on this branch, with the full connector suite green under CGO_ENABLED=0, twice identical. One behavior change for maintainer sign-off: a persistent download failure now blocks window completion instead of checkpointing past it.
|
LGTM |
Description
When Dropbox returns a download error, the connector reports a successful batch and checkpoints past the failed file. Resume skips it, and normal sync completion advances the time window past its modification time.
Return the wrapped download error with an empty batch, and commit the session index only after all downloads in the batch succeed. SyncRunner already propagates NextBatch errors without completing the window. Retrying the same session or reopening from the last committed checkpoint replays the uncommitted batch. Successful zero-byte downloads retain the existing skip behavior.
Tradeoff: a persistently unavailable file blocks completion of its sync window until the source is repaired. Previously omitted files require a full sync.
Related Issues
Closes #21808.
Related but separate: #21772 (WebDAV); #21794 (Dropbox timestamp selection, not modified here).
Module(s) Affected
Testing
Baseline: main@94369fc289e61be2f7e43bd0c65862269207d9c4. macOS arm64, Go 1.27.3. Tested tree ffcca6a5c87d069c994d769b245855e169b5f30d matches remote commit 261ffc3.
Checklist
Additional Notes
AI-assisted investigation, implementation and testing; no human review claim. The runner/watermark consequence was traced in source; executed verification stops at the connector session boundary.