Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endless loop in RRuleIterator::nextDaily #566

Open
KristofferFM opened this issue Mar 15, 2022 · 2 comments
Open

Endless loop in RRuleIterator::nextDaily #566

KristofferFM opened this issue Mar 15, 2022 · 2 comments

Comments

@KristofferFM
Copy link
Contributor

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.

@alecpl
Copy link
Contributor

alecpl commented Nov 29, 2022

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.

@KristofferFM
Copy link
Contributor Author

KristofferFM commented Nov 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants