emersion / go-webdav

A Go library for WebDAV, CalDAV and CardDAV
MIT License
317 stars 67 forks source link

caldav: fix validation error when VTIMEZONE is after VEVENT #106

Closed krystiancha closed 2 years ago

krystiancha commented 2 years ago

If in a calendar file VTIMEZONE component is after VEVENT then on the second pass of the comp loop uid is not blank (set from VEVENT) but compUID is blank (set from VTIMEZONE). This wrongly causes error conflicting UID values in calendar.

emersion commented 2 years ago

Hm, we should also probably check compUID != "".

krystiancha commented 2 years ago

Wouldn't compUID != "" && uid != compUID be enough then?

emersion commented 2 years ago

Yeah, that should work too.

My comment above was mentioning something else: we should check that VEVENT/VTODO/VJOURNAL/VFREEBUSY have a UID prop. But it's kind of separate.