tutao / tutanota

Tuta is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
https://tuta.com
GNU General Public License v3.0
6.05k stars 522 forks source link

Negative SEQUENCE value causes .ics file import to fail #3864

Open vitoreiji opened 2 years ago

vitoreiji commented 2 years ago

Trying to import the following calendar file fails and tells the user "Sorry, the file is not readable."

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20220314T000000Z
SUMMARY:2022 Pi Day
SEQUENCE:-314
END:VEVENT
END:VCALENDAR

The RFC states that this field is an integer (as opposed to a non-negative integer), so this should not fail. On the other hand, the RFC also says that the value starts at 0 and increases monotonically, so it is implicitly non-negative.

In any case, we have at least one case in the wild of a user trying to import a file with negative sequences, and it probably doesn't hurt to allow it.

As of 3.108.0, the server makes no assumptions about the value in this field.

ganthern commented 1 year ago

If we allow this, we should maintain the sequence number as-is instead of resetting it to zero. That would also mean that we're exporting negative sequences from then on.

We should make sure that other providers can handle that before actually doing that - if not, I'd rather close this as not planned.