From 2b62c5540ee9b111a97aa9e312d5f9e029700b20 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 18 Oct 2022 12:31:02 +1300 Subject: [PATCH] Bug 1795797 - If a CalDAV sync response says there are more items, request the items. r=mkmelin Differential Revision: https://phabricator.services.mozilla.com/D159553 --HG-- extra : rebase_source : 84e2233422c85041668a788e842920a96b8b2113 extra : amend_source : 3d7d2017e89d5df78bade151a44a5025db754d02 --- .../caldav/modules/CalDavRequestHandlers.jsm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/calendar/providers/caldav/modules/CalDavRequestHandlers.jsm b/calendar/providers/caldav/modules/CalDavRequestHandlers.jsm index 88f5f65af7..78f221c404 100644 --- a/calendar/providers/caldav/modules/CalDavRequestHandlers.jsm +++ b/calendar/providers/caldav/modules/CalDavRequestHandlers.jsm @@ -569,7 +569,7 @@ class CalDavWebDavSyncHandler extends XMLResponseHandler { return; } - if (this.calendar.mWebdavSyncToken == null) { + if (this.calendar.mWebdavSyncToken == null && !this.additionalSyncNeeded) { // null token means reset or first refresh indicating we did // a full sync; remove local items that were not returned in this full // sync @@ -597,6 +597,16 @@ class CalDavWebDavSyncHandler extends XMLResponseHandler { this.calendar.mWebdavSyncToken = this.newSyncToken; this.calendar.saveCalendarProperties(); cal.LOG("CalDAV: New webdav-sync Token: " + this.calendar.mWebdavSyncToken); + + if (this.additionalSyncNeeded) { + let wds = new CalDavWebDavSyncHandler( + this.calendar, + this.baseUri, + this.changeLogListener + ); + wds.doWebDAVSync(); + return; + } } this.calendar.finalizeUpdatedItems(this.changeLogListener, this.baseUri); }