Title: fix(cloudflare): Send correct events in local development · Issue #19901 · getsentry/sentry-javascript · GitHub
Open Graph Title: fix(cloudflare): Send correct events in local development · Issue #19901 · getsentry/sentry-javascript
X Title: fix(cloudflare): Send correct events in local development · Issue #19901 · getsentry/sentry-javascript
Description: NoteThe pull request "fix(cloudflare): Send correct events in local development" was created by @JPeer264 but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear. When using wr...
Open Graph Description: NoteThe pull request "fix(cloudflare): Send correct events in local development" was created by @JPeer264 but did not reference an issue. Therefore this issue was created for better visibility in e...
X Description: NoteThe pull request "fix(cloudflare): Send correct events in local development" was created by @JPeer264 but did not reference an issue. Therefore this issue was created for better visib...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/19901
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(cloudflare): Send correct events in local development","articleBody":"> [!NOTE]\n> The pull request \"[fix(cloudflare): Send correct events in local development](https://github.com/getsentry/sentry-javascript/pull/19900)\" was created by @JPeer264 but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.\n\nWhen using `wrangler dev` there is an isolation scope spawned as in production, but there is only **one** for the worker and the durable object (DO) (while in production these two get 1 each). With local development this could be a problem with the flush. The RPC is done inside the worker, which means at the time the DO is getting called the initial worker async local storage (ALS) is overwritten by the DO. That leads to a wrong client when the worker flushes after all calls are done. Here a little mermaid graph to showcase this a little better:\r\n\r\n```mermaid\r\nsequenceDiagram \r\n participant W as Worker\r\n participant ALS as AsyncLocalStorage \r\n participant DO as Durable Object\r\n participant S as Sentry Proxy \r\n \r\n W->>ALS: Initialize ALS context (Worker client) \r\n W->>DO: stub.fetch(request) \r\n DO->>ALS: Initialize ALS context (DO client) \r\n Note over ALS: ALS now holds DO client\u003cbr/>(single-threaded wrangler dev\u003cbr/>overwrites Worker context) \r\n DO->>S: flush() ✅ (DO client correct) \r\n DO-->>W: Response \r\n W->>ALS: getIsolationScope().getClient() \r\n Note over W,ALS: ❌ Returns DO client instead\u003cbr/>of Worker client \r\n W->>S: flush() ❌ (wrong client) \r\n Note over W: Worker events not flushed\u003cbr/>or flushed to wrong client \r\n```\r\n\r\nAs we already have the `client` available inside the flush function (as we pass it through), we can directly call it if it is available. \n","author":{"url":"https://github.com/apps/github-actions","@type":"Person","name":"github-actions"},"datePublished":"2026-03-20T08:49:33Z","url":"https://github.com/getsentry/sentry-javascript/issues/19901"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:60da6647-7a92-5c62-2eaf-e3e27619db51 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD7E:424F5:1B1F39:245E59:6B04E5FA |
| html-safe-nonce | 3941ed2cd5bfc223c7d876dc179e0feffe7247b72ed2be2bc20a512a8005a25b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDdFOjQyNEY1OjFCMUYzOToyNDVFNTk6NkIwNEU1RkEiLCJ2aXNpdG9yX2lkIjoiMzM4NjEwMzA1Nzc2NjIxMzExNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0616b9dd530586cca769ad061678b8f3948db5bfbea08ca7019779a9e4b00257 |
| hovercard-subject-tag | issue:4106665381 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/19901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b67cd1e274328cb201a066b882b3c058b65a0e3c346c6ba5011d1ebac17b3336/getsentry/sentry-javascript/issues/19901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b67cd1e274328cb201a066b882b3c058b65a0e3c346c6ba5011d1ebac17b3336/getsentry/sentry-javascript/issues/19901 |
| og:image:alt | NoteThe pull request "fix(cloudflare): Send correct events in local development" was created by @JPeer264 but did not reference an issue. Therefore this issue was created for better visibility in e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | github-actions[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 970f03f35f02bb123d2b6f1884601d89a570dc02e5ef9612b1b6ca5c033b1796 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ebcec4199c8521b643c068ef118a1ba9a43b678a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width