Repository navigation
fix(poller): run N/1 schedules from N to the end of the field - #358
Conversation
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
left a comment
There was a problem hiding this comment.
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.
|
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. |



Addresses the schedule finding from review of #353: an explicit
N/1matched only minute N.weathermap_cron_part()now opens the upper bound whenever a step is given, not only when it is greater than 1, so5/1matches 5 through 59 like crontab. BareNandN-M/stepare unchanged.The schedule test adds
5/1at 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