Google 修改日历信息(名称、描述等)后日历 ETag 未更新

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

我使用 Google 日历 API v3 来检索用户的 CalendarList,每个 CalendarListEntry 包含有关日历的基本信息,例如摘要(标题)、描述等等

返回的 CalendarListEntry 有一个 etag 属性,根据 Google 文档,只要修改日历,它就应该更改。

但是在测试期间,我更改了 Google 日历的名称、描述等,它们根本不会触发任何 etag 更新。

那么如何在不与我的应用程序中的本地副本进行全面比较的情况下确定日历的信息(不是事件,而是日历的元数据,如标题等)是否发生了变化?

这可能是一个错误

此问题已在此处报告:

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

也许这是一个错误。给它一个 ☆ 让 Google 知道它影响你。

解决方法

虽然 CalendarList list 请求 etag 不反映日历名称的变化,但 Calendar get 请求会。

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

  • 列出日历
  • 遍历 ID 并对每个日历发出简单的获取请求。

更新

没注意到 documentation 中涵盖了对 etag 的非普遍支持:

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)

所以这不是错误,它“按预期工作”。

如果您想更改此设置,则需要提交功能请求!