Skip to content

feat(v10): Streamline isolation scope handling & reset in isolation scopes - #24152

Open
JPeer264 wants to merge 1 commit into
v10from
feat/v10-streamline-isolation-scope-propagation-context
Open

feat(v10): Streamline isolation scope handling & reset in isolation scopes#24152
JPeer264 wants to merge 1 commit into
v10from
feat/v10-streamline-isolation-scope-propagation-context

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 7, 2026

Copy link
Copy Markdown
Member

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.ts and packages/deno/src/async.ts. The propagation context reset in withIsolationScope is applied to all three.
  • The cloudflare and deno copies share the current scope by reference in withIsolationScope on v10 (develop forks it since feat(server-utils): Implement setAsyncLocalStorageAsyncContextStrategy #22889, which is not on v10). The backport forks the current scope in those two withIsolationScope implementations, otherwise the reset would overwrite the caller's propagation context. withSetIsolationScope and withSetScope are left as they are on v10.
  • The packages/server-utils/test/async-context.test.ts cases are added to packages/cloudflare/test/async.test.ts (plus one case for the current-scope fork above) and to packages/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.
  • Dropped the packages/vercel-edge/test/middlewareTraceIsolation.test.ts hunk; 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/

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.76 kB added added
@sentry/browser - with treeshaking flags 26.2 kB added added
@sentry/browser (incl. Tracing) 46.62 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.41 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.38 kB added added
@sentry/browser (incl. Tracing, Replay) 85.88 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.5 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.61 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.25 kB added added
@sentry/browser (incl. Feedback) 44.94 kB added added
@sentry/browser (incl. sendFeedback) 32.56 kB added added
@sentry/browser (incl. FeedbackAsync) 37.69 kB added added
@sentry/browser (incl. Metrics) 28.85 kB added added
@sentry/browser (incl. Logs) 29.07 kB added added
@sentry/browser (incl. Metrics & Logs) 29.77 kB added added
@sentry/react 29.57 kB added added
@sentry/react (incl. Tracing) 48.88 kB added added
@sentry/vue 33.18 kB added added
@sentry/vue (incl. Tracing) 48.59 kB added added
@sentry/svelte 27.79 kB added added
CDN Bundle 30.15 kB added added
CDN Bundle (incl. Tracing) 48.58 kB added added
CDN Bundle (incl. Logs, Metrics) 31.73 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.88 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.02 kB added added
CDN Bundle (incl. Tracing, Replay) 86.1 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.41 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.9 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.18 kB added added
CDN Bundle - uncompressed 89.89 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.7 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.6 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.68 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.43 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.97 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.7 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.66 kB added added
@sentry/nextjs (client) 51.43 kB added added
@sentry/sveltekit (client) 47.04 kB added added
@sentry/core/server 80.79 kB added added
@sentry/core/browser 66.95 kB added added
@sentry/node-core 63.33 kB added added
@sentry/node 126.02 kB added added
@sentry/node (incl. diagnostics channel injection) 170.11 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 51.47 kB added added
@sentry/node - without tracing 75 kB added added
@sentry/aws-serverless 84.26 kB added added
@sentry/cloudflare (withSentry) - minified 202.71 kB added added
@sentry/cloudflare (withSentry) 499.12 kB added added

@JPeer264
JPeer264 marked this pull request as ready for review September 7, 2026 11:51
@JPeer264
JPeer264 requested review from a team as code owners September 7, 2026 11:51
@JPeer264
JPeer264 requested review from isaacs, logaretm and mydea and removed request for a team September 7, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants