Repository navigation
fix(libsync): resume a TUS upload from the server's offset on a 409 mismatch - #971
Merged
TheOneRing merged 1 commit intoJul 22, 2026
Merged
Conversation
…ismatch A stale or diverged TUS resume gets HTTP 409 (Upload-Offset mismatch). It used to fall through to commonErrorHandling and the upload wedged: the file hangs near 100%, never completes, and recovery needs a manual remove and re-add of the sync folder. Route a 409 in PropagateUploadFileTUS::slotChunkFinished() through the same HEAD-to-get-current-offset recovery path already used for timeouts, so the upload resumes from the server's canonical Upload-Offset. classifyError() additionally maps 409 to a recoverable SoftError that sets anotherSyncNeeded as a fallback, so the file is retried and the run re-discovered instead of being finalized with a silent gap. test/testtusresume.cpp pins the classifyError fallback contract (bug-bites-verified: fails against the pre-fix classifyError). Fixes opencloud-eu#898 Authored-By: Bernard Gütermann <[email protected]>
TheOneRing
approved these changes
Jul 13, 2026
Contributor
|
Thank you for your contribution |
TheOneRing
enabled auto-merge (rebase)
July 13, 2026 08:56
Contributor
|
The crashing unit test is unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Second half of the #960 split. Fixes #898.
Problem
A stale TUS resume gets HTTP 409 (Upload-Offset mismatch) and falls into commonErrorHandling, where the upload wedges: the file hangs near 100% and only a manual remove and re-add of the folder recovers it (#898).
Fix
Tests
test/testtusresume.cpp pins the classifyError fallback (fails pre-fix, passes with the fix). The transport recovery reuses the existing timeout path rather than adding a new one.
Full ctest on the CI image: 31/32. The one failure is testfolderwatcher, environment-only on my build host (inotify limit, unrelated).
Fixes #898