You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@sentry/cloudflare: The runtime cancels the closing check-in of withMonitor and events in withIsolationScope when the handler returns #25373
Start a local ingest on 127.0.0.1:8969. The ingest waits 10 ms before it answers each request. It logs a request as CANCELLED when the client closes the connection before the answer. Ours is a raw TCP server in Bun.
Run wrangler dev --test-scheduled.
Request GET /__scheduled?cron=foo, then GET /fetch/foo.
Expected Result
The ingest receives three envelopes: the in_progress check-in of foo, the ok check-in of foo, and the event bar.
Actual Result
The runtime cancels the closing check-in and the event:
opened 17:00:34.344Z RECEIVED check_in foo in_progress
opened 17:00:34.365Z CANCELLED at 34.366Z check_in foo ok
opened 17:00:34.995Z CANCELLED at 34.998Z event "bar"
Additional Context
withMonitor, withIsolationScope, trpcMiddleware and wrapMcpServerWithSentry fork the isolation scope. setInvocationState (packages/cloudflare/src/utils/invocationContext.ts) stores the invocation state under a symbol key, and Scope.clone() does not copy it. In the fork, the client sends each envelope at once without waitUntil, and the runtime cancels it when the handler returns.
In 10 scenarios across scheduled, fetch, queue, a Durable Object and a Workflow step, the runtime cancelled 27 of 70 envelopes.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Activity
linear-code commentedon Oct 14, 2026
JS-3938
JPeer264 commentedon Oct 15, 2026
Thanks for opening the ticket and the PR. I'll take a look at your PR now