Repository navigation
fix: recompute all cron next-run times after job update - #15905
Merged
Takhoffman merged 3 commits intoFeb 14, 2026
Merged
Conversation
The update path only recomputed nextRunAtMs for the patched job and only when schedule or enabled changed. Non-schedule patches (e.g. delivery target) could leave the scheduler with stale timing state, causing jobs to stop executing entirely. Now mirrors the add() path by calling recomputeNextRuns(state) after every mutation, ensuring all jobs have consistent nextRunAtMs values.
Takhoffman
force-pushed
the
fix/15750-cron-rearm-after-update
branch
from
February 14, 2026 18:36
0d151a7 to
a826fe4
Compare
Contributor
|
PR #15905 - fix: recompute all cron next-run times after job update (#15905) Merged via squash.
Thanks @echoVic! |
Contributor
|
Why these changes were made:
|
Contributor
Author
|
Thanks for the refinement! The per-job repair approach makes much more sense — I hadn't considered that a global recompute could silently advance unrelated due jobs. Appreciate the detailed explanation and the regression tests. 🙏 |
akoscz
pushed a commit
to akoscz/openclaw
that referenced
this pull request
Feb 15, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
vincentkoc
pushed a commit
to vincentkoc/openclaw
that referenced
this pull request
Feb 15, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…) thanks @echoVic Verified: - pnpm check - pnpm vitest src/cron/service.issue-regressions.test.ts src/cron/service.issue-13992-regression.test.ts Co-authored-by: echoVic <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
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.
Fixes #15750
Problem
After updating a cron job's non-schedule properties (e.g., delivery target), the scheduler's
nextWakeAtMsdid not recalculate properly. ALL cron jobs could stop executing.The
update()path only recomputednextRunAtMsfor the patched job and only whenscheduleorenabledchanged. Non-schedule patches (e.g., delivery target, payload message) left the scheduler with stale timing state.Fix
Added
recomputeNextRuns(state)call after every job mutation in theupdate()path, mirroring whatadd()already does. This ensures all jobs have consistentnextRunAtMsvalues regardless of which fields were patched.Changes
src/cron/service/ops.ts: CallrecomputeNextRuns(state)after applying patch and beforepersist()/armTimer()Greptile Overview
Greptile Summary
Added defensive
recomputeNextRuns(state)call in theupdate()path after any job mutation to ensure all cron jobs maintain consistentnextRunAtMsvalues, mirroring the existing pattern inadd(). This prevents potential scheduler breakage when non-schedule properties (e.g., delivery target, payload) are updated without triggering the conditional recomputation logic that only ran for schedule/enabled changes.Confidence Score: 5/5
Last reviewed commit: e13bdd8