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

Providing hour and minute in an hourly frequency hangs on rrule.all call #468

Open
Ashwinkumar-R opened this issue Jun 22, 2021 · 5 comments

Comments

@Ashwinkumar-R
Copy link

Reporting an issue

When calling rrule.all with the below-mentioned rruleset, no response is received back and looks like rrule.all() hangs. The hang seems to happen when we provide byhour and byminute parameters with values. When it is null then everything is fine. This happens randomly with the demo app, where the page hangs.

  • rruleset - {"freq":4,"byhour":"11","byminute":"02","bysecond":0,"byweekday":null,"bymonthday":null,"interval":6,"tzid":"Asia/Kolkata","bysetpos":null,"dtstart":"2021-06-03T00:00:00.000Z","until":"2021-08-04T23:59:59.000Z"}
  • Expected output - results with valid schedules
  • Actual output - no response is received
  • version - 2.6.4
  • OS - Windows 10
  • local timezone - Asia/Kolkata
@sebacruz
Copy link

sebacruz commented Sep 5, 2021

I'm having the same issue.

It's hanging out when using all() and between().

@jetchoong-dev
Copy link

Yes me too, having the same issue, my rrule body is like below

{
  freq: Frequency.MINUTELY,
  interval: 120,
  byweekday: [RRule.MO, RRule.TU, RRule.SU],  
  byhour: [1,2,3,4,5,6,7], // from 01:00 to 08:00
  until: moment(schedule.end_date).toDate(), // a javascript date object 
}

One strange behaviour I noticed when I input a full week days (Monday - Sunday) for byweekday, the .all() iterator works fine but not when I try to input intermittent days like MO, TU, SU, the iterator for sure freeze. Generally speaking, when value of byweekday have a gap day then iterator hangs.

Spent 2 days to dig this thing out!

@codingedgar
Copy link

@Ashwinkumar-R @sebacruz @jetjet-dev Have you found any workaround for this scenario?

@maxmarchuk
Copy link

Commenting here in case my fix works for anyone else.
My problem was that I was initializing the RRule object with incorrect data types, particularly freq was a string ( "1" ).
Casting a number fixed the problem.

@huaichaow
Copy link

huaichaow commented Mar 26, 2024

this PR should fix the issue:
#622


@Ashwinkumar-R
in your case, the byhour is odd(11) and the interval is even (6), the code will never find a match, which creates an infinite loop causing the app to hang. please check the PR for more.

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

6 participants