Closed sunkup closed 3 months ago
It might be cleaner to repair all events at once, after all the exceptions have been found, before returning them in Event.eventsFromReader().
👍🏻 The Validator should be kind of an interface that validates and repairs events, but the calling code should not know details (like that it deals with rrules of exceptions or whatever).
So we should only expose the repair()
and call it at the right time:
(which should be documented in KDoc of EventValidator)
Because we can't do everything we need from fromVEvent()
, we should call repair()
when the complete event is available. And then we can adapt the tests, too.
Would love if this PR would not only fix the issue, but also make event validation a bit more documented.
Purpose
Obsolete recurrence rules were not being removed from recurrence exceptions properly. This happens due to repairing single events right away, before "knowing" their exceptions. With this PR "removal of exceptions" is done only after all events have been created with all known exceptions. That is any repairs are done after completely reading an iCalendar and before writing.
Description
EventValidator.removeRRulesOfExceptions()
inEvent.eventsFromReader()
.EventValidator.repair()
only after all exceptions have been found - after completely reading an iCalendarEventValidator
repair()
method tovalidateAndRepair()