Google CalDAV:重新创建会议

时间:2014-10-08 09:15:41

标签: google-calendar-api caldav

SyncEvolution用户报告了在Google日历中镜像本地日历的问题:通过CalDAV刷新Google日历时(=删除所有事件并使用PUT重新创建),某些PUT命令失败并显示" 404 Not实测值"

对于有ORGANIZER(即会议)的VEVENT来说,这种情况似乎发生了。它适用于没有ORGANIZER的更简单的VEVENT。下面的失败示例。

我认为这是谷歌CalDAV的一个已知限制。问题是:在客户端或服务器中可以做些什么来支持这个用例?

我无法想到客户端的任何解决方法。 404错误太不明确,无法触发解决方法,即使客户端可以检测到它的根本原因,也没有其他方法可以重新创建事件而不是失败的PUT。


PUT /caldav/v2/patrick.ohly.estamos%40googlemail.com/events/4fbbdbd8-c9de-4ce0-810a-01e3a438a35d-pohly-xyz.ics HTTP/1.1
Connection: TE
TE: trailers
Host: apidata.googleusercontent.com
Content-Length: 928
Content-Type: text/calendar; charset=utf-8
User-Agent: SyncEvolution
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sending request-line and headers:
Sending request body:
Body block (928 bytes):
[BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Synthesis AG//NONSGML SyncML Engine V3.4.0.47//EN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:STANDARD
DTSTART:20071104T020000
RRULE:FREQ=MONTHLY;INTERVAL=12;BYDAY=1SU
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:HNP
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20070311T020000
RRULE:FREQ=MONTHLY;INTERVAL=12;BYDAY=2SU
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:HAP
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
STATUS:CONFIRMED
LAST-MODIFIED:20120813T184814Z
DTSTAMP:20120813T184814Z
UID:4fbbdbd8-c9de-4ce0-810a-01e3a438a35d-pohly-xyz
SEQUENCE:0
CLASS:PUBLIC
TRANSP:OPAQUE
SUMMARY:test event
DTSTART;TZID=America/Los_Angeles:20120815T103000
DTEND;TZID=America/Los_Angeles:20120815T113000
ATTENDEE;CN=John Doe;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:
 mailto:john.doe@example.com
ORGANIZER;CN=Joan Doe:mailto:joan.doe@example.com
END:VEVENT
END:VCALENDAR
]
Request sent; retry is 1.
[status-line] < HTTP/1.1 201 Created

...

DELETE /caldav/v2/patrick.ohly.estamos%40googlemail.com/events/4fbbdbd8-c9de-4ce0-810a-01e3a438a35d-pohly-xyz.ics HTTP/1.1
Connection: TE
TE: trailers
Host: apidata.googleusercontent.com
Content-Length: 0
User-Agent: SyncEvolution
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sending request-line and headers:
Request sent; retry is 1.
[status-line] < HTTP/1.1 204 No Content

...

PUT /caldav/v2/patrick.ohly.estamos%40googlemail.com/events/4fbbdbd8-c9de-4ce0-810a-01e3a438a35d-pohly-xyz.ics HTTP/1.1
Connection: TE
TE: trailers
Host: apidata.googleusercontent.com
Content-Length: 928
Content-Type: text/calendar; charset=utf-8
User-Agent: SyncEvolution
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sending request-line and headers:
Sending request body:
Body block (928 bytes):
[BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Synthesis AG//NONSGML SyncML Engine V3.4.0.47//EN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:STANDARD
DTSTART:20071104T020000
RRULE:FREQ=MONTHLY;INTERVAL=12;BYDAY=1SU
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:HNP
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20070311T020000
RRULE:FREQ=MONTHLY;INTERVAL=12;BYDAY=2SU
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:HAP
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
STATUS:CONFIRMED
LAST-MODIFIED:20120813T184814Z
DTSTAMP:20120813T184814Z
UID:4fbbdbd8-c9de-4ce0-810a-01e3a438a35d-pohly-xyz
SEQUENCE:0
CLASS:PUBLIC
TRANSP:OPAQUE
SUMMARY:test event
DTSTART;TZID=America/Los_Angeles:20120815T103000
DTEND;TZID=America/Los_Angeles:20120815T113000
ATTENDEE;CN=John Doe;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:
 mailto:john.doe@example.com
ORGANIZER;CN=Joan Doe:mailto:joan.doe@example.com
END:VEVENT
END:VCALENDAR
]
Request sent; retry is 1.
[status-line] < HTTP/1.1 404 Not Found

1 个答案:

答案 0 :(得分:0)

(我不了解SyncEvolution,但最近我在谷歌日历上的一些经验可能会有所启发。我不确定是否有令人满意的答案。)

这可能是一个问题(即使没有DELETE):

假设用户U PUTs有参与者但U不是组织者的事件。发生的事情是U&#34;抢断&#34;事件(成为组织者)并在其他人的日历上插入事件的(可能)只读副本。注意:对于带有ATTENDEES的活动,Google日历会使所有者/创建者/插入者成为组织者。然后,UID被保持&#34;第一个提到它的ATTENDEE。由于Google日历上不存在重复的UID,因此其他ATTENDEES会在后续PUT上发生错误。

当从一个日历(但不是全部)中删除事件并且UID仍然保持&#34;时,情况会变得更糟。有人。或者删除以某种方式实际上不会删除UID(可以在谷歌日历上发生)。

缓解策略:

对于有组织者的活动,只有PUT进入组织者的日历。

如果您无法完成上述操作(以及导致事件变为未连接重复的结果),那么UUID会以某种方式独特 -