Allow negative alarm trigger values to be stored in the database
Currently, we only store positive alarm trigger values on alarm aggregate types in the database in the format <positive integer><time unit> where time unit is "W", "D", "H" or "M" for weeks, days, hours or minutes. These values specify the time offset relative to event start at which the alarm should go off. Positive values are used to for alarms that should go off before the event, specifying an offset backwards in time.
Our goal is to allow offsets, forwards in time relative to the event start, because the iCal spec supports such offsets, and we are receiving reports of alarms dropped in such cases. To achieve this goal we first want to support serializing and writing negative alarm trigger values to the database, and also parsing-in negative trigger values from the database. These values will be used to specify offsets forwards in time.
It's important to note that this is confusing because the sign of the value stored in the database is the reverse of what you'd expected. But we've decided on this solution for now because it maintains backwards compatibility with our current data-model and old values in the database will continue to be valid.
After support for the database changes has been fully released, we will release the changes to the iCal parser to allow of positive alarm trigger durations to be parsed. This 2-phase release allows us to avoid potential errors that users may encounter if negative values are stored in the database using the new version of the web client and retrieved by an old version of a smartphone client that has not updated to the new version because of phased rollout. The changes to the parser are tracked in issue https://github.com/tutao/tutanota/issues/11565.
TODOs
- Run new swift unit tests
Test Notes
None... Unit-tests should be enough. Actual manual testing will be done for the parser changes, tracked in issue https://github.com/tutao/tutanota/issues/11565.
Source: tutao/tutanota