René's URL Explorer Experiment


Title: [cloudflare] Events captured in detached work inside Durable Objects are silently dropped (per-invocation client disposal + flush-only transport) · Issue #22545 · getsentry/sentry-javascript · GitHub

Open Graph Title: [cloudflare] Events captured in detached work inside Durable Objects are silently dropped (per-invocation client disposal + flush-only transport) · Issue #22545 · getsentry/sentry-javascript

X Title: [cloudflare] Events captured in detached work inside Durable Objects are silently dropped (per-invocation client disposal + flush-only transport) · Issue #22545 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...

Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/22545

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[cloudflare] Events captured in detached work inside Durable Objects are silently dropped (per-invocation client disposal + flush-only transport)","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/cloudflare\n\n### SDK Version\n\n10.62.0\n\n### Framework Version\n\nwrangler 4.113.0, compatibility_date 2026-06-16, compatibility_flags = [\"nodejs_compat\"]\n\n### Link to Sentry event\n\n(events never arrive — that is the bug; org stats show 0 received / 0 filtered for the affected captures)\n\n### Reproduction Example/SDK Setup\n\nDurable Object instrumented with `instrumentDurableObjectWithSentry`. The DO's fetch handler kicks off background work that outlives the invocation — a common DO pattern (queue drains, agent runloops; e.g. the `agents` SDK runs \"fibers\" exactly like this):\n\n```js\nclass RoomBase extends DurableObject {\n  async fetch(request) {\n    // fire-and-forget continuation (same shape as agents-SDK fibers)\n    void (async () => {\n      await new Promise((r) => setTimeout(r, 3000));\n      Sentry.captureException(new Error(\"captured from detached work\"));\n    })();\n    return Response.json({ ok: true });\n  }\n}\nexport const Room = instrumentDurableObjectWithSentry(sentryOptions, RoomBase);\n```\n\nDeployed verbatim (minus names) and verified: **the event never arrives** — not delayed, never. `captureException` inside the detached continuation is a silent no-op. Captures from the fetch handler itself, and even from `ctx.waitUntil`-registered work, arrive fine in the same worker.\n\n### Steps to Reproduce\n\n1. Instrument a DO with `instrumentDurableObjectWithSentry`.\n2. From `fetch`, start a detached async continuation (not awaited, not passed to `ctx.waitUntil`) that captures an exception after the invocation settles.\n3. Trigger the fetch.\n\n### Expected Result\n\nThe event is delivered, or at minimum the SDK surfaces (debug log) that a capture hit a disposed client so the drop isn't silent.\n\n### Actual Result\n\nNothing is sent and nothing is logged. Mechanism, as far as we can tell from reading the SDK:\n\n1. `wrapRequestHandler` / `wrapMethodWithSentry` create a per-invocation client and dispose it via `waitUntil(flushAndDispose(client))` when the invocation settles.\n2. The detached continuation inherits the invocation's isolation scope through AsyncLocalStorage, so later `captureException` calls run against the **disposed** client.\n3. `makeCloudflareTransport` uses `IsolatedPromiseBuffer`, so events are only ever transmitted on `flush()` — any capture that misses its scope's flush window is unrecoverable.\n\nReal-world impact: our production DO (a chat agent on the cloudflare `agents` SDK, where every turn runs as a detached fiber) reported **zero errors for 13 days** — every `captureException` from turn code was dropped — while the same code paths kept logging to Workers Logs. Nothing in the SDK hinted at the drop; we found it by diffing org ingest stats (0 received) against console output.\n\nTwo follow-up observations from building a workaround, in case they're useful:\n\n- Workaround that works: wrap the detached body in `wrapRequestHandler({ options, request: new Request(\"https://do.detached/\u003cname>\"), context: this.ctx }, body)` to give it a body-scoped client. **However**, in our production DO the wrapper's own teardown flush (`waitUntil(flushAndDispose)`) still did not deliver — we additionally had to drain the transport explicitly inside the handler (`getClient()?.getTransport()?.flush(...)`) before it settles. In a minimal DO the teardown path delivered fine, so there seems to be a further interaction (flush-lock vs. long-lived `ctx.waitUntil` registrations?) we could not minimize. Happy to run diagnostics if useful.\n- While doing that we also noticed `CloudflareClient.flush()` awaits pending-span completion; calling it from inside an active request span therefore always stalls for the full timeout — worth a doc note, since flushing \"before the invocation ends\" is exactly what a detached-work workaround wants to do.\n\nFeature-ask version of this issue: a supported primitive for detached/background DO work (e.g. `Sentry.withDetachedScope(name, fn)` that binds a body-scoped client and flushes on settle), plus a debug-mode warning when `captureException` resolves to a disposed client.","author":{"url":"https://github.com/Soju06","@type":"Person","name":"Soju06"},"datePublished":"2026-07-23T10:18:13Z","url":"https://github.com/getsentry/sentry-javascript/issues/22545"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4e5b2847-7193-feb3-2bd4-0580e7daf9c7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id88B8:14562A:3F3334:559590:6B0438D3
html-safe-nonce3e0b2fc2e30a6b1754fbf42a8ab568156bd3f50008c331ff7fea5b2bf1e70813
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEI4OjE0NTYyQTozRjMzMzQ6NTU5NTkwOjZCMDQzOEQzIiwidmlzaXRvcl9pZCI6IjM2NjIzMjQ0Mjk0NTk0Mzc2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfd4bd949b033502c59577133d5312fa6452246f2062fb97ebbe06235e6b5a822
hovercard-subject-tagissue:4957819601
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/22545/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c3b733cf9580e80ebe4f2a2903012e40ea4f3a8a1c981acdace84a10c04b7797/getsentry/sentry-javascript/issues/22545
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c3b733cf9580e80ebe4f2a2903012e40ea4f3a8a1c981acdace84a10c04b7797/getsentry/sentry-javascript/issues/22545
og:image:altIs there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSoju06
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/22545#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F22545
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F22545
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22545
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22545
Reloadhttps://github.com/getsentry/sentry-javascript/issues/22545
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests55 (55)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22545
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22545
#23151https://github.com/getsentry/sentry-javascript/pull/23151
[cloudflare] Events captured in detached work inside Durable Objects are silently dropped (per-invocation client disposal + flush-only transport)https://github.com/getsentry/sentry-javascript/issues/22545#top
#23151https://github.com/getsentry/sentry-javascript/pull/23151
https://github.com/JPeer264
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
https://github.com/Soju06
Soju06https://github.com/Soju06
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issue-4957819601
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28375945194
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28375950048
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issuecomment-5057266970
Linear Codehttps://linear.app
JS-3127https://linear.app/getsentry/issue/JS-3127
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545
github-actionshttps://github.com/apps/github-actions
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28375950392
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jul 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28375971204
JPeer264https://github.com/JPeer264
on Jul 24, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28421152095
https://github.com/andreiborza
andreiborzahttps://github.com/andreiborza
on Jul 24, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issuecomment-5070691090
@Soju06https://github.com/Soju06
@JPeer264https://github.com/JPeer264
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 24, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28439868762
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 24, 2026https://github.com/getsentry/sentry-javascript/issues/22545
https://github.com/JPeer264
JPeer264https://github.com/JPeer264
on Jul 28, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issuecomment-5100756721
JPeer264https://github.com/JPeer264
on Jul 30, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-28706008044
feat(cloudflare): Add experimental.cacheClient to reuse the client ac…https://github.com/getsentry/sentry-javascript/commit/b624208a8e093e2de79b50bd1a7e1d466aaeeebf
b624208https://github.com/getsentry/sentry-javascript/commit/b624208a8e093e2de79b50bd1a7e1d466aaeeebf
feat(cloudflare): Add experimental.cacheClient to reuse the client ac…https://github.com/getsentry/sentry-javascript/commit/6dc8b4ea280bf81a8110e77641b3d5d8c1ad05f5
6dc8b4ehttps://github.com/getsentry/sentry-javascript/commit/6dc8b4ea280bf81a8110e77641b3d5d8c1ad05f5
feat(cloudflare): Add experimental.cacheClient to reuse the client ac…https://github.com/getsentry/sentry-javascript/commit/07fec29973ed2677d1a77d2e86bf8a45385241ca
07fec29https://github.com/getsentry/sentry-javascript/commit/07fec29973ed2677d1a77d2e86bf8a45385241ca
feat(cloudflare): Add experimental.cacheClient to reuse the client ac…https://github.com/getsentry/sentry-javascript/commit/05172b3c1f03f3646711c0db6e9228d38fcbb794
05172b3https://github.com/getsentry/sentry-javascript/commit/05172b3c1f03f3646711c0db6e9228d38fcbb794
feat(cloudflare): Add experimental.cacheClient to reuse the client ac…https://github.com/getsentry/sentry-javascript/commit/54fc3d71cb27d94d0f4f4c2cfd6edb652b718c34
54fc3d7https://github.com/getsentry/sentry-javascript/commit/54fc3d71cb27d94d0f4f4c2cfd6edb652b718c34
JPeer264https://github.com/JPeer264
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#23151https://github.com/getsentry/sentry-javascript/pull/23151
on Aug 25, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-29981621708
JPeer264https://github.com/JPeer264
on Aug 25, 2026https://github.com/getsentry/sentry-javascript/issues/22545#event-29981623067
feat(cloudflare): Add cacheClient to reuse the client across invocati…https://github.com/getsentry/sentry-javascript/commit/7c9971301a517dfae6c80346f93fcb1c4beef825
https://docs.github.com/articles/closing-issues-via-commit-messages
7c99713https://github.com/getsentry/sentry-javascript/commit/7c9971301a517dfae6c80346f93fcb1c4beef825
https://github.com/JPeer264
JPeer264https://github.com/JPeer264
on Aug 26, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issuecomment-5423215449
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Sep 23, 2026https://github.com/getsentry/sentry-javascript/issues/22545#issuecomment-5795081084
GitHub Actionshttps://help.github.com/en/actions
#23151https://github.com/getsentry/sentry-javascript/pull/23151
11.0.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.0.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/22545
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/22545
JPeer264https://github.com/JPeer264
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Cloudflare Workershttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Cloudflare%20Workers%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.