Skip to content

fix(poller): run N/1 schedules from N to the end of the field - #358

Merged
TheWitness merged 1 commit into
developfrom
fix/cron-explicit-step-one
Nov 16, 2026
Merged

TheWitness merged 1 commit into
developfrom
fix/cron-explicit-step-one

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Addresses the schedule finding from review of #353: an explicit N/1 matched only minute N. weathermap_cron_part() now opens the upper bound whenever a step is given, not only when it is greater than 1, so 5/1 matches 5 through 59 like crontab. Bare N and N-M/step are unchanged.

The schedule test adds 5/1 at minutes 5, 6 and 59 (match) and 4 (miss); it fails on develop at minute 6. Full Pest suite on PHP 8.3 in Docker: 716 passed, 1 failed (ColourConfigConcurrencyTest, which fails the same way on develop in that container). No CHANGELOG change, since the existing unreleased 2.1 entry for #351 already covers schedule step handling.

Fixes #357

weathermap_cron_part() only extended an N/step item to the end of the
field when the step was greater than 1, so an explicit N/1 matched
minute N alone. Key the open upper bound off the presence of a step
instead, matching crontab, and cover 5/1 in the schedule test.

Fixes #357

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof added the bug Something isn't working label Nov 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

@somethingwithproof somethingwithproof left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking correctness or security findings in the current diff at 687ef93.

The explicit-step check correctly distinguishes N/1 from bare N. The former runs from N through the current calendar field; bare N and bounded N-M/step retain their previous semantics. I checked the actual calendar caller as well as the field matcher: it supplies bounded minute, hour, day, month and weekday values, so the open internal upper bound does not extend execution beyond the field.

The changed path adds no SQL, shell, filesystem, or authorization boundary. Step zero is still rejected before modulo, malformed items do not match, and the existing linear scan over comma-separated alternatives remains unchanged.

Validation: the focused cron tests pass (2 tests, 21 assertions), and an independent enumeration passed 166,656 comparisons across real calendar-field domains, explicit steps, bounded ranges, singleton values, lists, invalid forms, and calendar-level calls. The current head also has successful PHP 8.2-8.6 integration, browser, CodeQL and Sonar checks.

Recommendation: approve. Submitted as a comment because GitHub does not permit approval of one's own PR.

@alcatron

Copy link
Copy Markdown
Contributor

Checked the current diff and independently exercised the field matcher across minute, hour, day, month and weekday ranges: 27,330 comparisons passed, covering explicit steps (including /1), bare values and invalid/zero steps. The distinction between 5 and 5/1 is correct. No further changes found in this check; the current GitHub checks are also green.

This was a focused matcher check, not another full-suite or live-poller run.

@TheWitness
TheWitness merged commit a2eebc8 into develop Nov 16, 2026
10 checks passed
@TheWitness
TheWitness deleted the fix/cron-explicit-step-one branch November 16, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map schedule N/1 matches only minute N

3 participants