feat(v10): Streamline isolation scope handling & reset in isolation scopes - #24152
Open
JPeer264 wants to merge 1 commit into
Open
feat(v10): Streamline isolation scope handling & reset in isolation scopes#24152JPeer264 wants to merge 1 commit into
JPeer264 wants to merge 1 commit into
Conversation
…copes Backport of: #22890
Contributor
size-limit report 📦
|
JPeer264
marked this pull request as ready for review
September 7, 2026 11:51
JPeer264
requested review from
isaacs,
logaretm and
mydea
and removed request for
a team
September 7, 2026 11:51
3 tasks
mydea
approved these changes
Sep 7, 2026
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.
Backport of: #22890
Differences to the original PR
packages/server-utils/does not exist on v10. The AsyncLocalStorage async context strategy lives in three copies there:packages/node-core/src/light/asyncLocalStorageStrategy.ts,packages/cloudflare/src/async.tsandpackages/deno/src/async.ts. The propagation context reset inwithIsolationScopeis applied to all three.withIsolationScopeon v10 (develop forks it since feat(server-utils): ImplementsetAsyncLocalStorageAsyncContextStrategy#22889, which is not on v10). The backport forks the current scope in those twowithIsolationScopeimplementations, otherwise the reset would overwrite the caller's propagation context.withSetIsolationScopeandwithSetScopeare left as they are on v10.packages/server-utils/test/async-context.test.tscases are added topackages/cloudflare/test/async.test.ts(plus one case for the current-scope fork above) and topackages/node-core/test/light/asyncLocalStorageStrategy.test.ts. There is no vitest suite for the deno strategy, so that copy is not covered by a unit test.packages/vercel-edge/test/middlewareTraceIsolation.test.tshunk; that file does not exist on v10.Fixes #24118
Before: https://sentry-sdks.sentry.io/explore/traces/trace/aeac0f0087dc4636af1c1ea2080dc8be/
After: https://sentry-sdks.sentry.io/explore/traces/trace/94a5f3cc2384449ab8fe0891c69cfc75/