ical.js icon indicating copy to clipboard operation
ical.js copied to clipboard

Should Event.isRecurrenceException() check for properties other than `RECURRENCE-ID`?

Open dstearnsadobe opened this issue 7 years ago • 1 comments

I'm using the ical-expander package to expand recurring events, but I noticed a problem with ical data returned from g-suite calendars. The free Google calendars don't seem to do this, but the g-suite calendars are auto-expanding recurring events, returning ical data like this:

Example link: https://calendar.google.com/calendar/ical/601t.com_a029mt9oo3j20r5okc98g4lfe4%40group.calendar.google.com/public/basic.ics

Returned iCal Data

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Test
X-WR-TIMEZONE:America/Los_Angeles
X-WR-CALDESC:Test public calendar
BEGIN:VEVENT
DTSTART:20181012T190000Z
DTEND:20181012T200000Z
DTSTAMP:20180910T215427Z
UID:[email protected]
ATTENDEE;X-NUM-GUESTS=0:mailto:[email protected]
 lendar.google.com
RECURRENCE-ID:20181012T190000Z
SUMMARY:Busy
END:VEVENT
BEGIN:VEVENT
DTSTART:20181005T190000Z
DTEND:20181005T200000Z
DTSTAMP:20180910T215427Z
UID:[email protected]
ATTENDEE;X-NUM-GUESTS=0:mailto:[email protected]
 lendar.google.com
RECURRENCE-ID:20181005T190000Z
SUMMARY:Busy
END:VEVENT
BEGIN:VEVENT
DTSTART:20180928T190000Z
DTEND:20180928T200000Z
DTSTAMP:20180910T215427Z
UID:[email protected]
ATTENDEE;X-NUM-GUESTS=0:mailto:[email protected]
 lendar.google.com
RECURRENCE-ID:20180928T190000Z
SUMMARY:Busy
END:VEVENT
BEGIN:VEVENT
DTSTART:20180921T190000Z
DTEND:20180921T200000Z
DTSTAMP:20180910T215427Z
UID:[email protected]
ATTENDEE;X-NUM-GUESTS=0:mailto:[email protected]
 lendar.google.com
RECURRENCE-ID:20180921T190000Z
SUMMARY:Busy
END:VEVENT
BEGIN:VEVENT
DTSTART:20180914T190000Z
DTEND:20180914T200000Z
DTSTAMP:20180910T215427Z
UID:[email protected]
ATTENDEE;X-NUM-GUESTS=0:mailto:[email protected]
 lendar.google.com
RECURRENCE-ID:20180914T190000Z
SUMMARY:Busy
END:VEVENT

... more events ...

END:VCALENDAR

I created only one recurring event on the calendar. Note that it's returning multiple VEVENT records, each of which with a RECURRENCE-ID property.

This causes problems in the ical-expander because it uses your Event.isRecurrenceException() method to determine if a record is a recurrence exception. That method returns true if the event has a RECURRENCE-ID property.

https://github.com/mozilla-comm/ical.js/blob/5ae4372f1fad2ef19f315e358b1f46fe4ca1ec5e/lib/ical/event.js#L301

I might be misunderstanding RFC 5545, but I thought RECURRENCE-ID just referred back to the original event in the recurrence series, and EXDATE was used on recurrence exceptions. If so, then I think the implementation of isRecurrenceException() should check for EXDATE, not RECURRENCE-ID. But please correct me if I'm misunderstanding things!

dstearnsadobe avatar Sep 14 '18 19:09 dstearnsadobe

I know this is old, but there are any updates about this?

I have the same issue, some events have recurrence-id but are not meant to be an exception, but the library just omits them

dancalderon avatar Jul 17 '23 18:07 dancalderon

Words are hard when concepts are very similar. I believe I took the naming from Thunderbird/Lightning code back in the days. Under that terminology, a "recurrence exception" is an occurrence of an event that is an "exception to the rule", not in the sense that it is removed, but rather in the sense that it is different than the main event because something was changed.

I think it would be reasonable to change the wording to something like isModifiedOccurrence but that will require a breaking change. I'll add this to #663 to make the change when enough things have accumulated.

kewisch avatar May 04 '24 22:05 kewisch