pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.6k stars 199 forks source link

improperly imports events with ancient CREATED entry #1090

Open jonassmedegaard opened 3 years ago

jonassmedegaard commented 3 years ago

khal import fails to import events containing this:

CREATED:00001231T000000T

Judging from internet chatter, such data seemingly originate from Google, and is arguably bogus (RFC 5545 does not explicitly constrain which years can be expressed, but no calendar agent stored the data in an RFC 5545 store in year 0).

The imported data has transformed the event to contain this:

CREATED:None

That data certainly is broken.

If arguably-bogus year-0 data cannot be preserved as-is, then khal should not mangle it into even more broken data. One better option that some suggest and I find reasonable is to replace year 0 with year 1970. Other less ideal options are to skip the event or to halt the import routine.

d7415 commented 3 years ago

I haven't had time to look in detail, but my immediate reactions are: 1)

CREATED:00001231T000000T

...

That data certainly is broken.

2) Skipping the event or halting are undesirable behaviours for most of our users. 3) I would argue that preserving nonsense data isn't important - If the creation date was important, Google would have supplied it instead of junk data.

It may be worth looking at whether we can store this as-is. I would certainly object to skipping events because of one optional field that contains incorrect data, but if we can't store it as is, a warning would probably be worthwhile.