vobject
vobject copied to clipboard
Endless loop in RRuleIterator::nextDaily
An example is this RRULE that will trigger the problem if the corresponding DTSTART is not on a monday:
FREQ=DAILY;INTERVAL=7;BYDAY=MO
I am in doubt about if this rule should
- Expand into instances happening on mondays, no matter what weekday is in DTSTART
- Create no expansion at all
I will create a pull request for 2) afterwards, but as said, I am a bit in doubt if that is the best possible solution.
According to the RFC 5545: "The recurrence set generated with a "DTSTART" property value not synchronized with the recurrence rule is undefined".
I see some more options to choose from: 3. Expand into instances happening on mondays, plus add an occurrence on DTSTART. 4. Throw an exception.
I'm not sure which is the best for this library, but an endless loop should be fixed.
The endless loop is fixed as part of the pull request related to this issue and released in 4.4.0. However, the current solution is not at all optimal as it just iterates into the future until it gives up at some fixed point in time. This approach is found several places in the code handling recurrence rules.