[sync] Fix endless upload loop when a locally modified resource was deleted on the server - #2741
Open
sunkup wants to merge 2 commits into
Conversation
rfc2822
requested changes
Aug 3, 2026
rfc2822
left a comment
Member
There was a problem hiding this comment.
I think we need to fully understand and evaluate our 4xx (especially 404/412) handling before we can modify it.
See #2739 (comment) – but needs proper verification and then we can choose an approach. We should probably have a common understanding first.
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.
Purpose
Fixes #2739: a resource that is modified locally and deleted on the server by another client is uploaded again in every sync, forever. Some servers (like DAViCal) answer 412 instead of 404 to our conditional
PUT, because per RFC 9110 13.1.1 anIf-Matchagainst a non-existing resource must fail with 412. We treat every 412 as "modified on the server in the meanwhile" and ignore it, so the resource stays dirty — but it can never be downloaded, anddeleteNotPresentRemotely()skips dirty rows, so nothing resolves it. Affects contacts and events, too.Short description
SyncManager.uploadTargetIsGone(), which sends aPROPFINDto find out whether the upload target is still on the server.uploadDirty()now use it: if the resource is gone, the upload is retried as a fresh upload (forceAsNew) — the same resolution we already apply when a server answers 404.Related: RFC 9110, section 13.1.1.
Checklist