vobject icon indicating copy to clipboard operation
vobject copied to clipboard

Endless loop in RRuleIterator::nextDaily

Open KristofferFM opened this issue 2 years ago • 2 comments

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

  1. Expand into instances happening on mondays, no matter what weekday is in DTSTART
  2. 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.

KristofferFM avatar Mar 15 '22 13:03 KristofferFM

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.

alecpl avatar Nov 29 '22 09:11 alecpl

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.

KristofferFM avatar Nov 29 '22 09:11 KristofferFM