Use numeric DAV sync tokens#277
Open
AnnoyingTechnology wants to merge 1 commit into
Open
Conversation
SabreDAV performs range comparisons and numeric ordering on sync tokens. Storing CardDAV tokens as strings makes incremental sync fail once tokens cross a decimal-width boundary such as 9 to 10.\n\nMigrate calendar and address-book tokens consistently across SQLite, MariaDB, and PostgreSQL, preserve the compound sync index during SQLite column replacement, and cover the boundary with a backend regression test.
Owner
|
Hi Thanks Claude for identifying this miss. On the matter
The rest seem sound. On the form |
Author
|
It's gpt5.6-sol, not slopus but point taken. I rewrote a Dav server from scratch yesterday as it was quicker to reach my requirements, so won't be pushing for these PR. I leave it up to you to take what you deem useful to your project. |
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.
Why
SabreDAV performs numeric range comparisons and ordering on sync tokens. Davis stores the CardDAV parent and change tokens as strings, so a request spanning a decimal-width boundary can be evaluated lexically: token
10sorts before token9.In practice, an incremental address-book sync starting at token 9 can return no changes after the collection advances through 10. The problem is visible on SQLite and applies to the string-backed schema on MariaDB and PostgreSQL as well.
Sync tokens are generated and incremented numerically by SabreDAV. Their database and entity types should reflect that invariant.
What changed
The migration version intentionally precedes the companion index migration, but it also handles installations that apply the index PR first.
Verification