fix(core): reuse runtime World for route handlers - #3666
Draft
MintedKenny wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Kenneth <kenneth@standardforensics.com>
🦋 Changeset detectedLatest commit: 77b28b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
Contributor
|
@MintedKenny is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: Kenneth <kenneth@standardforensics.com>
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.
Description
Fixes #3665.
workflowEntrypoint()now initializes its request-time queue handler fromgetWorld()instead ofgetWorldHandlers(). This makes route initialization and subsequent runtime operations share one process-level World instance.The public
getWorldHandlers()API, its signature, and its intentionally separate build-time-safe cache are unchanged.Previously, route initialization populated the handler-only cache and the first runtime operation independently populated the runtime cache. Stateful async World factories could therefore create duplicate database pools, listeners, queue workers, or similar process-scoped resources.
How did you test your changes?
getWorld().@workflow/coresuite on Node 24: 101 test files passed, 1 skipped; 2,180 tests passed, 3 expected failures, 1 skipped.@workflow/coretypechecking successfully.The full documentation code-sample harness requires built workspace package declarations. The partial local build cannot produce every package because the SWC package requires a Rust toolchain that is not installed; CI remains the authoritative full-workspace result.
Docs Preview
Vercel did not produce an accessible
workflow-docspreview for this fork PR: its deployment checks require Vercel Labs authorization. The changed v5 routes are:/v5/docs/api-reference/workflow-runtime/workflow-entrypoint/v5/docs/api-reference/workflow-runtime/get-world-handlersPR Checklist - Required to merge
pnpm changesetwas run to create a patch changelog for this PRgit commit --signoff)@vercel/workflowonce the PR is ready for review