Caldav - deleting a single occurrence of a recurring event

Hello!

I noticed that when you delete an instance of a recurring event, it doesn’t disappear from the calendar in Gladys.

I’m using Google Calendar (yes, I know…).

An example?

A class every Wednesday, so recurring, which I delete on the days it’s a holiday still appears after deletion and forced synchronization!

Hello @GBoulvin,

Thanks for the feedback! I looked at the CalDAV sync code: normally, a deleted occurrence is properly taken into account. When the recurring event is modified on the server, Gladys recalculates all its occurrences, then deletes those that no longer exist. I tested the two ways a deleted occurrence can be described:

  • an exclusion date (EXDATE) on the recurring event;
  • a « canceled » occurrence (RECURRENCE-ID + STATUS:CANCELLED), which Google sometimes uses.

In both cases, the occurrence disappears for me. I therefore suspect rather a particularity of the incremental sync with Google: it might not report the recurring event as modified when you delete just one of its occurrences.

To settle this, can you try this?

  1. In the CalDAV integration, disable then re-enable the synchronization of this calendar. This clears the calendar in Gladys and fully resynchronizes it. Do the deleted classes reappear?
  2. Let me know your Gladys version.
  3. If possible, send me the Gladys logs right after a forced synchronization. I’m looking for the lines CalDAV: X events updated, Y events deleted for calendar ....
  4. If the occurrences are still there after step 1, export your agenda from Google (Settings > Import and export > Export). Then copy here the block BEGIN:VEVENT … END:VEVENT of the class, anonymizing if necessary. I’m especially looking for the lines DTSTART, RRULE, EXDATE and/or RECURRENCE-ID.

With that, I’ll be able to see if the problem comes from the sync or the interpretation of the event, and correct accordingly.

Hi!

I unchecked the calendars, checked them again and then clicked « synchronize ».

The events that appeared are correct but I have an error:

Error: Bad status: 403
    at XMLHttpRequest.request.onreadystatechange (/src/server/services/caldav/node_modules/dav-request/dav.js:3393:27)
    at Timeout._onTimeout (/src/server/services/caldav/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js:1089:51)
    at listOnTimeout (node:internal/timers:685:17)
    at processTimers (node:internal/timers:618:7)

If I delete a recurring event, it doesn’t disappear but the error comes back and the synchronization seems to fail.

Thanks @GBoulvin, that’s exactly the info I needed!

After a full resync, the occurrences are correct. Gladys therefore correctly interprets deleted occurrences: the problem comes from the incremental sync.

With each sync, Gladys sends Google a « sync token » to retrieve only what has changed since the last time. Google can invalidate this token and then responds with an error 403. In this case, the client must resync everything, but Gladys was sending the same invalid token each time. As a result, all syncs for this calendar failed: the deletion of the occurrence never arrived, and the error returned with each attempt.

I proposed a fix: fix(caldav): synchronize all the events again when the sync token is rejected by cicoub13 · Pull Request #3324 · GladysAssistant/Gladys · GitHub

When the token is rejected, Gladys now fully resyncs the calendar and deletes events that no longer exist on Google.

In the meantime, the workaround remains to disable and then re-enable the concerned calendar in the CalDAV integration.