vdirsyncer icon indicating copy to clipboard operation
vdirsyncer copied to clipboard

Retry PUT 409 errors - delete and re-create event

Open telotortium opened this issue 3 years ago • 6 comments

Attempt to address #963

I would appreciate a code review here - there might be a more elegant way to address this problem, but it works for my (very limited) use case.

telotortium avatar Jan 18 '22 21:01 telotortium

@WhyNotHugo Thanks for your comments. I agree that I need to figure out how to make these changes more correct before merging, but I don't understand CalDAV or the code well enough to know what I need to do. These hacks are just what I need to get the sync in my configuration working.

telotortium avatar Mar 30 '22 02:03 telotortium

A few tests are stil failing: https://builds.sr.ht/~whynothugo/job/776820#task-test-134

WhyNotHugo avatar Jun 09 '22 07:06 WhyNotHugo

any updates on this?

g0rdonL avatar Dec 02 '22 02:12 g0rdonL

Basically each time that vdirsyncer reads an event, we also get an Etag, which can be though of as a version identifier. The Etag for an event changes each time that its content changes. When vdirsyncer tries to delete or alter an event, it specifies "only if the Etag is equal to XXX". This avoids deleting an event if someone else has modified it after vdirsyncer last read it.

A 409 error means that we tried a write operation on an event assuming it had not changed, but it has changed. If this keeps happening over and over, it likely means that there is an issue elsewhere in the logic. But in the general case, ignoring a 409 error means that you're overwriting or deleting files which have been modified by someone else, and will result in a data loss.

I honestly haven't looked deeply into the cause of this bug because it sounds very non-trivial, and I'd rather focus energy on the rewrite which should either not have this bug, or be a lot easier to debug.

WhyNotHugo avatar May 25 '23 15:05 WhyNotHugo