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

[Bugfix] Weekly interval rules are sometimes calculated incorrectly #487

Merged
merged 11 commits into from
Oct 25, 2021

Conversation

jakebrady5
Copy link
Contributor

The spec covers the context through which this bug was uncovered. Essentially generating occurrences_between for a relatively small date range was yielding false occurrences for weekly interval rules.

I observed that @time = @start_time if @time < @start_time was set to happen only when @start_time was falsey. Iterations past the first for a given rule in Schedule#next_time here in situations similar to the spec would pass in a time that was less than start_time.

Since @start_time was already defined in the rule, this @time value would be passed long for validation.

Most rules will then return immediately in this case, not applying their validation.

Any feedback is welcome!

@jakebrady5
Copy link
Contributor Author

❤️ thank you @pacso

@pacso
Copy link
Collaborator

pacso commented Oct 22, 2021

This looks correct @seejohnrun

@seejohnrun
Copy link
Collaborator

Thank you!

@pacso
Copy link
Collaborator

pacso commented Oct 25, 2021

Of course, with the new checks this build now fails with a missing update to the changelog.

Could you do the honours @jakebrady5?

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@pacso pacso merged commit 656c0c4 into ice-cube-ruby:master Oct 25, 2021
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

Successfully merging this pull request may close these issues.

4 participants