Repository navigation
fix(core): preserve long workflow wait durations - #1558
1828703450qqcom-ux wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 78378c8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
PR Checklist
Bugs / Features
What is the current behavior?
A workflow sleep of 30 days can continue after about 1 ms.
andSleep,andSleepUntil, and workflow retry delays share a helper that passes the whole duration tosetTimeout. Node.js reduces delays greater than2_147_483_647ms to 1 ms. Node.js timer documentationWhat is the new behavior?
The helper waits in intervals that stay within the timer limit until the requested duration elapses. Cancellation and suspension can still interrupt the current interval.
Notes for reviewers
mainand pass with the fix. One checks that the full delay elapses. The other checks cancellation during the second interval and confirms the timer is cleared.@voltagent/coreVitest workflow suite passed all 166 tests, including the six existing sleep tests and the two new regressions.Summary by cubic
Fixes workflow sleep steps so they wait for their full requested duration instead of resolving early. Delays over
2_147_483_647ms (~24.8days) previously causedsetTimeoutto fire after ~1 ms, so a 30-day sleep would complete almost immediately.The wait helper now chunks long durations into intervals below the timer limit while still supporting cancellation and suspension. Added regression tests for full-duration waits, and for cancellation and suspension after a chunk elapses.
Written for commit 78378c8. Summary will update on new commits.
Summary by CodeRabbit