Repository navigation
fix(cron): reject schedule numbers that stop early - #111
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
strtol and strtoll accepted a numeric prefix, so at:2026-10-08 stored next_run 2026. That one-shot was already due, ran on the next poll, and ack deleted it. Comma lists such as 1,3,5 matched only the first value and still scheduled. Co-authored-by: esadrianno <esadrianno@gmail.com>
This branch has not been deployed
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.
Bug and impact
cron_parse_next_runtreated a numeric prefix as a full schedule value.at:2026-10-08(orat:tomorrow) storednext_runas2026or0. That timestamp is already due, so the next cron poll ran the one-shot immediately andcron_ack_deliverydeleted it. The future reminder was lost.cron:0 9 * * 1,3,5andcron:0 9 1,15 * *were accepted and matched only the first number, so the job ran on the wrong days.interval:60abcwas accepted as 60 seconds.Dashboard
POST /api/cronand the cron tool both call this parser.Root cause
strtol/strtollstop at the first non-digit. The parser checked that conversion started, then ignored the remainder.Fix
Require the entire numeric token to be consumed for
at:,interval:, and cron fields (*, a single number, orN-Mstill work). A partial value is rejected andnext_runis left unchanged, so the job is not created.Validation
make test_cronfailed onat:2026-10-08before the parser change and passes after it, including the existing schedule cases.