-
-
Notifications
You must be signed in to change notification settings - Fork 54.5k
Closed
Description
Bug Description
When updating cron jobs with timezone changes, the nextRunAtMs calculation occasionally produces incorrect values. Observed a 72-hour (3-day) offset where Friday was skipped to Monday.
Steps to Reproduce
- Create a cron job with expression
0 8 * * 1-5andtz: America/Los_Angeles - At ~10:35 PM CST Thursday, update multiple jobs in parallel (via tool calls) to change timezone to
America/Chicago - Observe that one job gets incorrect
nextRunAtMs(Monday instead of Friday)
Expected Behavior
Job with 0 8 * * 1-5 updated at 10:35 PM Thursday (CST) should schedule next run for Friday 8 AM CST.
Actual Behavior
- 2 of 3 jobs updated simultaneously got correct values
- 1 job (day-of-week constrained
1-5) got Monday Feb 9 instead of Friday Feb 6
Evidence
Direct testing with croner library returns correct result:
const { Cron } = require('croner');
const now = new Date('2026-02-06T04:35:22.877Z'); // 10:35 PM CST Thursday
const cron = new Cron('0 8 * * 1-5', { timezone: 'America/Chicago' });
cron.nextRun(now); // Returns Friday Feb 6, 8 AM ✅But stored nextRunAtMs was 1770645600000 (Monday Feb 9, 8 AM).
Environment
- OpenClaw version: 2026.2.3-1
- OS: macOS Darwin 24.6.0 (arm64)
- Node: v22.22.0
Hypothesis
Possible race condition in parallel job updates, or state corruption during persist. The croner library is correct; issue is between library call and persisting result.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels