niccokunzmann/python-recurring-ical-events

VALARM event properties not carried over

Opened this issue · 4 comments

When parsing a calendar with recurring_ical_events, the resulting events differ from the original in that they do not contain the VALARM attribute.

Example event input

BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:redacted
DTSTART;TZID=Europe/Berlin:20190527T140000
DTEND;TZID=Europe/Berlin:20190527T163000
DTSTAMP:20190510T070457Z
UID:00000000-0000-0000-0000-000000000000
SEQUENCE:4
ATTENDEE;CN=redacted;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:redacted@example.com
ATTENDEE;CUTYPE=RESOURCE;PARTSTAT=ACCEPTED;ROLE=NON-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CUTYPE=RESOURCE;PARTSTAT=ACCEPTED;ROLE=NON-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
CLASS:PUBLIC
DESCRIPTION:redacted
LAST-MODIFIED:20190510T070457Z
LOCATION:redacted@example.com
ORGANIZER;CN=redacted;SENT-BY="mailto:redacted@example.com":mailto:redacted@example.com
STATUS:CONFIRMED
TRANSP:OPAQUE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MS-OLK-SENDER:mailto:redacted@example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER;RELATED=START:-PT10M
END:VALARM
END:VEVENT
END:VCALENDAR

Output:

BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:redacted
DTSTART;TZID=Europe/Berlin:20190527T140000
DTEND;TZID=Europe/Berlin:20190527T163000
DTSTAMP:20190510T070457Z
UID:00000000-0000-0000-0000-000000000000
SEQUENCE:4
ATTENDEE;CN=redacted;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CN="redacted";PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:redacted@example.com
ATTENDEE;CUTYPE=RESOURCE;PARTSTAT=ACCEPTED;ROLE=NON-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
ATTENDEE;CUTYPE=RESOURCE;PARTSTAT=ACCEPTED;ROLE=NON-PARTICIPANT;RSVP=TRUE:mailto:redacted@example.com
CLASS:PUBLIC
DESCRIPTION:redacted
LAST-MODIFIED:20190510T070457Z
LOCATION:redacted@example.com
ORGANIZER;CN=redacted;SENT-BY="mailto:redacted@example.com":mailto:redacted@example.com
STATUS:CONFIRMED
TRANSP:OPAQUE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MS-OLK-SENDER:mailto:redacted@example.com
END:VEVENT
END:VCALENDAR

I just noticed that this property is not part of the event, but instead of the calendar, and hence it is my own fault for not copying it.

-edit:
Actually, I saw wrong, and the property is part of the event. This issue is caused by event.copy() however, and hence not inherently the fault of this package.

However: If this is caused by event.copy and this package uses event.copy and you expect it to work otherwise, you can leave this open, open an issue in the icalendar package, reference this and see where this should be fixed. Maybe it is default in the icalendar package and ok and unexpected in this one.
Let me know what you think or if you think something should be changed here.

This fix is included in v0.1.15b. It is expected and useful to handle it like this.