arran4 / golang-ical

A ICS / ICal parser and serialiser for Golang.
Apache License 2.0
279 stars 72 forks source link

"Import failed to save." Calendar.app on macOS Catalina (With example) #19

Open dewey opened 4 years ago

dewey commented 4 years ago

Hey there,

I'm trying to generate an ics file and import it into Calendar.app of macOS Catalina. I'm getting the following error for the given file:

Screen Shot 2020-06-06 at 18 16 08

The ics file I'm trying to import is:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Arran Ubels//Golang ICS library
METHOD:REQUEST
BEGIN:VEVENT
UID:456
CREATED:20200610T181852Z
DTSTAMP:20200610T181852Z
LAST-MODIFIED:20200610T181852Z
DTSTART:20200610T181852Z
SUMMARY:Post scheduled 456
DESCRIPTION:description456
URL:456
END:VEVENT
BEGIN:VEVENT
UID:123
CREATED:20190821T080000Z
DTSTAMP:20190821T080000Z
LAST-MODIFIED:20190821T080000Z
DTSTART:20190821T080000Z
SUMMARY:Post scheduled 123
DESCRIPTION:description123
URL:123
END:VEVENT
END:VCALENDAR

If I remove one of the events so that there's only one in there it works:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Arran Ubels//Golang ICS library
METHOD:REQUEST
BEGIN:VEVENT
UID:456
CREATED:20200610T181852Z
DTSTAMP:20200610T181852Z
LAST-MODIFIED:20200610T181852Z
DTSTART:20200610T181852Z
SUMMARY:Post scheduled 456
DESCRIPTION:description456
URL:456
END:VEVENT
END:VCALENDAR

I'm running out of ideas what could cause that, it's a valid file according to: https://icalendar.org/validator.html#results

Do you have any idea what could happen there?

Thanks!

dewey commented 4 years ago

Just found that if I remove: METHOD:REQUEST it works. Maybe "Request" doesn't work if there are multiple VEVENT in the VCALENDAR.

arran4 commented 4 years ago

Any chance you can play around with it and figure out if I have implemented it wrong?

dewey commented 4 years ago

I'll see if I can spend some time on it but I can't promise anything. It was just a quick script where I used it.

arran4 commented 3 years ago

@dewey No problem. Let me know if you get time to look at it. I think this library needs some love IMHO.

starspace1 commented 3 years ago

Just found that if I remove: METHOD:REQUEST it works. Maybe "Request" doesn't work if there are multiple VEVENT in the VCALENDAR.

Yep! And THANK YOU for this comment, you made my week by getting me unstuck on an apple calendar .ics import bug with like, no documentation 🙏

arran4 commented 3 years ago

@starspace1 Is this something the library should be picking up? (Or is putting in the wrong location?) (If only I could get more time to work on the library.)

dewey commented 3 years ago

Just found that if I remove: METHOD:REQUEST it works. Maybe "Request" doesn't work if there are multiple VEVENT in the VCALENDAR.

Yep! And THANK YOU for this comment, you made my week by getting me unstuck on an apple calendar .ics import bug with like, no documentation 🙏

Ohh, nice find with the RFC! Good to know it's not just an obscure bug but actually the standard. Glad my stabbing in the dark was actually helpful to anyone else 😄

arran4 commented 2 years ago

@dewey Did you need anything from me on this or can I close the issue?

dewey commented 2 years ago

I think you can close it. I'm not using it at the moment but at least we documented the behavior in this issue for future search engine users 😀

arran4 commented 2 years ago

Oh okay. Wil you use it in the future?

dewey commented 2 years ago

Hey, unsure. My project is now built in Rails instead of Go so that's why I don't really have a use case right now. If I need a Go lib in the future I know where to look though :)