Search code examples
google-apigoogle-calendar-apigoogle-api-clientgoogle-api-dotnet-clientgoogle-client

Google calendar ETag not updated after modifying calendar info (name, description etc)


I use Google Calendar API v3 to retrieve a user's CalendarList, with each CalendarListEntry containing basic information about the calendar such as summary (title), description etc.

The returned CalendarListEntry has a etag property, which according to Google documentation, should change whenever a calendar is modified.

But during testing, I changed my Google calendar's name, description etc, and they do not trigger any etag updates at all.

So how do I find out if a calendar's information (not event, but calendar's meta data such as title etc) has changed without making a full comparison against my local copy in my app?


Solution

  • This may be a bug

    This issue has been reported here:

    https://issuetracker.google.com/issues/180946049

    Maybe it is a bug. Go give it a ☆ to let Google know that it affects you.

    Workaround

    While the CalendarList list request etag does not reflect change in calendar names, the Calendar get request does.

    https://developers.google.com/calendar/v3/reference/calendars/get

    • List the calendars
    • Loop through the IDs and make a simple get request for each calendar.

    Update

    Hadn't noticed that the non-universal support for etags is covered in the documentation:

    Every resource has a version field that changes every time the resource changes — the etag field. Etags are a standard part of HTTP and are supported in the calendar API for two cases:

    • on resource modifications to ensure that there has been no other write to this resource in the meantime (conditional modification)
    • on resource retrieval to only retrieve resource data if the resource has changed (conditional retrieval)

    So this is not a bug, it is "working as intended".

    If you want to change this, then you would need to file a feature request!