fix(cron): match restricted day fields with OR - #612
Merged
Merged
Conversation
Co-authored-by: WUU Agent <305930189+wuu-agent[bot]@users.noreply.github.com>
Co-authored-by: WUU Agent <305930189+wuu-agent[bot]@users.noreply.github.com>
Kaguya-19
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the Cron day-of-month/day-of-week matching rule. When both fields are restricted, Unix cron runs when either matches; PilotDeck previously required both.
For
0 9 1 * 1, starting at2026-06-02T00:00:00Z:2027-02-01T09:00:00Z(the next Monday that is also the first).2026-06-08T09:00:00Z(the next Monday).Changes
*. Keep AND for wildcard fields, including*/n, following Cronie's matching rule.0-6for wildcards.29 2 0-6must also run on other February dates under OR semantics.Validation
Using Node 22.23.3:
npm run build— passed.node --import tsx --test tests/cron/cron-schedule.test.ts tests/cron/cron-editing.spec.ts— 27 passed.f0ca40f4: 625 passed, 0 failed, the same 9 cancelled, 2 skipped (636 total). All 17 added tests pass.The pre-existing cancellations are seven cases in
tests/network/fetch.spec.tsand two intests/task/background-task-runtime.spec.ts, all reportingPromise resolution is still pending but the event loop has already resolved. They are outside this PR's scope.