Repository navigation
fix(pim): keep what Google's sync calls deleted but still serves - #46
Merged
Merged
Conversation
Google's CalDAV sync-collection calls some objects deleted, from no token as well, that its PROPFIND, a multiget and a GET still serve: single occurrences whose series is gone (a VEVENT with a RECURRENCE-ID and no master). Sync followed the sync and never stored them, so verify on the user's Gmail calendar showed 1384 on the server and 1382 here. A Gmail pass now asks for every href its sync calls deleted (the profile's new DAV.ServesDeleted), stores what the server sends and removes the rest. Migration 0016 clears Gmail calendars' sync state so the next pass lists them again and fetches the ones missed before. tools/davprobe compares, read-only, what sync-collection, PROPFIND and a multiget say of a collection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
mailctl verify 4showed the user's main Gmail calendar asDIFFERS: 1384 objects on the server, 1382 stored, with two missing locally. Sync never stored them, and it said nothing about them.Cause. Google's CalDAV
sync-collectioncalls both hrefs deleted (404), from no token and again in later deltas. ItsPROPFIND, acalendar-multigetand aGETall still serve them. Both are single occurrences whose series is gone: a VEVENT with aRECURRENCE-IDand no master, whichcalendar.Parse/Expandalready handle. Sync followed the sync-collection report.tools/davprobeshowed that 25 of the hrefs a full sync calls deleted remain, and Google serves exactly these two of them.Fix. Sync stores them; verify keeps counting them, since Google Calendar shows them.
providers.DAV.ServesDeleted(set for Gmail): on such a server,syncCollectionadds every href a sync calls deleted to the multiget. It stores what comes back, andfetchDAVremoves what doesn't. Other servers behave as before, so contract tests stand.sync_token/ctagonce. The next pass lists them in full and fetches only what is missing or has a different ETag.davtest.HideFromSyncimitates Google.TestServedObjectsCalledDeletedcovers a Gmail account through first sync, a change and a real deletion. It also covers a generic account, which follows its sync and reproduces the bug.TestMigration16ListsGmailCalendarsAgaincovers the migration.tools/davprobeis a read-only diagnostic. It compares sync-collection (no token, stored token,-token), PROPFIND and a multiget against the store.docs/design/pim.mddescribes the fix. Its Oct 9 note had accepted this gap.Test plan
make check: gofmt, vet, golangci-lint with 0 issues, unit tests including the Google replay, and the fork's testsreview.icsmissing locallypim_opsemptied, accountread_only = 1, HTTP refusing all but GET/PROPFIND/REPORT): after migration 0016 and one pass, verify was clean for every collection of account 4, with "Brian Ketelsen" at 1384/1384. Both objects were indexed as single occurrences with no parse error.mailctl verify 4is clean🤖 Generated with Claude Code