You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know it seems strange to not give the until parameter, but I encountered this in a context where it was a variable which was not always initialized and its value was nil, resulting in the following :
In my application, I have to count the number of dates generated with the recurrence parameters, which is why there is the count method used in the end (and it is this one causing the error).
I know the count method is not a Montrose method, so maybe you can't do something on your side to fix this ; but I was wondering if montrose should return an error if no end_date is given ?
I noticed the starts parameter could be omitted, and the current_date would be used by default. But you obviously cannot have a default end_date, because it makes no sense.
Do you think the gem should return an error, or at least a warning or something, if there is no end given for the recurrence ? 🤔
Thanks for your time and your thoughts on this 🙂
The text was updated successfully, but these errors were encountered:
Tao-Galasse
changed the title
Infinite loop when missing until parameter
Infinite loop when missing until parameter (and trying to .count the number of events)
Mar 8, 2023
It's a good question and an interesting idea. I can understand how raising an error on infinite loop for a subset of Enumerable methods would be useful. I don't immediately know of the best approach but I'd consider a patch with tests.
Hello @rossta ! 👋
First of all, thanks for your gem :)
I encountered a bug where montrose get stucked in an infinite loop in this scenario :
I know it seems strange to not give the
until
parameter, but I encountered this in a context where it was a variable which was not always initialized and its value wasnil
, resulting in the following :In my application, I have to count the number of dates generated with the recurrence parameters, which is why there is the
count
method used in the end (and it is this one causing the error).I know the
count
method is not a Montrose method, so maybe you can't do something on your side to fix this ; but I was wondering if montrose should return an error if no end_date is given ?I noticed the
starts
parameter could be omitted, and the current_date would be used by default. But you obviously cannot have a default end_date, because it makes no sense.Do you think the gem should return an error, or at least a warning or something, if there is no end given for the recurrence ? 🤔
Thanks for your time and your thoughts on this 🙂
The text was updated successfully, but these errors were encountered: