khal icon indicating copy to clipboard operation
khal copied to clipboard

Handle Google Calendar revisions/updates gracefully

Open ryzokuken opened this issue 5 years ago • 5 comments

Whenever someone changes an event on Google Calendar, I get an email for the update. As usually with new invites, I run khal import on the new ics file. However, it doesn't work as expected since Google Calendars sends a special "revision" ics file, and not just the updated ics file with the same UID.

For example, Original: UID:[email protected] New: UID:[email protected]

In this case, since the UID is not the same, khal fails to catch this case and creates a fresh new event instead of updating. This situation should instead be handled gracefully.

ryzokuken avatar Jun 24 '20 21:06 ryzokuken

I suppose a regex check for (\w+)_R\d{8}T\d{6}(@\w+.\w+) at/around https://github.com/pimutils/khal/blob/a401ef28076954779cc66885a05dd1fa7da46fe3/khal/controllers.py#L614 should do wonders :wink:

ryzokuken avatar Jun 24 '20 21:06 ryzokuken

Hi @ryannjohnson

This is not as easy, Google use of UID is not standardized one (check IETF RFC ). I think we can have problems with other calendar system for google misuse of UID out of RFC5545 scope.

We must look how others calendar user agent work, here for DAVDroid, Mozilla Thunderbird, khal or NextCloud there is not revision in UID.

ephase avatar Jul 06 '20 21:07 ephase

Thanks @ephase. I suppose checking Thunderbird should certainly help, since it doesn't have this issue. That said, it uses a special extension to deal with Google Calendars, so that might be what's up.

ryzokuken avatar Jul 07 '20 09:07 ryzokuken

Which add-on do you use for sync calendar on Thunderbird? A general caldav connector like this one or a Google calendar special add-on like this one

ephase avatar Jul 16 '20 20:07 ephase

@ephase I use the latter, but I just realized that the former cannot use the same calendars using the former either... So I suppose something is wrong with my GCal setup? Any known workarounds? Some subscribed calendars to my account show up but not all. It's important to me that subscribed calendars show up as well.

ryzokuken avatar Jul 17 '20 04:07 ryzokuken