René's URL Explorer Experiment


Title: Express request-handler span never ends when the client aborts, dropping its subtree from the http.server transaction · Issue #25183 · getsentry/sentry-javascript · GitHub

Open Graph Title: Express request-handler span never ends when the client aborts, dropping its subtree from the http.server transaction · Issue #25183 · getsentry/sentry-javascript

X Title: Express request-handler span never ends when the client aborts, dropping its subtree from the http.server transaction · Issue #25183 · getsentry/sentry-javascript

Description: Package + version @sentry/react-router 10.55.0 (also reproduced on 11.5.0, both traceLifecycle: "static" and the default "stream"), express 4, Node 22. Description The Express layer patch ends a terminal request_handler layer span only o...

Open Graph Description: Package + version @sentry/react-router 10.55.0 (also reproduced on 11.5.0, both traceLifecycle: "static" and the default "stream"), express 4, Node 22. Description The Express layer patch ends a te...

X Description: Package + version @sentry/react-router 10.55.0 (also reproduced on 11.5.0, both traceLifecycle: "static" and the default "stream"), express 4, Node 22. Description The Express l...

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

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":"Express request-handler span never ends when the client aborts, dropping its subtree from the http.server transaction","articleBody":"### Package + version\n@sentry/react-router 10.55.0 (also reproduced on 11.5.0, both `traceLifecycle: \"static\"` and the default `\"stream\"`), express 4, Node 22.\n\n### Description\nThe Express layer patch ends a terminal `request_handler` layer span only on `res.once(\"finish\")` (10.x: `@sentry/core/.../express/patch-layer.js`; 11.x: `@sentry/server-utils/.../express/instrumentation.js`). The `http.server` root span ends on `response.on(\"close\")`.\n\nWhen the client aborts the request before the response completes, `close` fires but `finish` never does. The handler span is never ended, so:\n\n- **static (10.x and 11.x):** the `http.server` transaction is sent with only the already-ended passthrough middleware spans. The handler span and everything under it are missing (loaders, DB spans).\n- **11.x stream:** the loader/DB spans are sent, but their parent (the handler span) never is, so they are orphaned in the trace view.\n\nThis hits React Router's `createRequestHandler` all the time in production. A superseded client navigation aborts the `.data` fetch, and those are usually the slow requests, which are exactly the ones you want to see.\n\n### Reproduction\n`init.mjs`:\n```js\nimport * as Sentry from \"@sentry/react-router\";\nSentry.init({\n  dsn: \"https://public@o0.ingest.sentry.io/0\",\n  tracesSampleRate: 1.0,\n  tracePropagationTargets: [],\n  traceLifecycle: \"static\",\n  beforeSendTransaction(event) {\n    console.log(\"TXN\", event.transaction, (event.spans ?? []).map((s) => s.op));\n    return null;\n  },\n});\n```\n`app.cjs`:\n```js\nconst Sentry = require(\"@sentry/react-router\");\nconst express = require(\"express\");\nconst app = express();\napp.use((req, res, next) => next());\napp.use(async (req, res) => {\n  await Sentry.startSpan({ name: \"loader\", op: \"function.react_router.loader\" },\n    () => new Promise((r) => setTimeout(r, 800)));\n  res.end(\"ok\");\n});\nconst server = app.listen(0, async () => {\n  const url = `http://127.0.0.1:${server.address().port}/x`;\n  await fetch(url);\n  await new Promise((r) => setTimeout(r, 300));\n  await fetch(url, { signal: AbortSignal.timeout(100) }).catch(() => {});\n  await new Promise((r) => setTimeout(r, 2000));\n  await Sentry.flush(1000);\n  process.exit(0);\n});\n```\n`node --import ./init.mjs app.cjs`\n\n### Expected\nThe aborted request's transaction contains the handler span (ended at `close`, ideally marked cancelled) and its loader child, same as the completed request.\n\n### Actual (3/3 runs)\n```\nTXN GET /x [ 'middleware', 'middleware', 'function.react_router.loader' ]   \u003c- completed\nTXN GET /x [ 'middleware' ]                                                  \u003c- aborted\n```\n\n### Still present on `develop`\n`packages/server-utils/src/integrations/express/instrumentation.ts:358` only registers `res.once('finish', onFinish)`. #24854 changed when layer spans end on `next()`, but not the abort path.\n\n### Suggested fix\nAlso end the layer span on `res.once(\"close\")`, not only `\"finish\"`.\n","author":{"url":"https://github.com/mlavesther","@type":"Person","name":"mlavesther"},"datePublished":"2026-10-08T12:50:46Z","url":"https://github.com/getsentry/sentry-javascript/issues/25183"}

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:0807c093-f147-9790-9998-e20d110ed2e9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB3DA:339D75:9FAC53:DFAD08:6B042FD3
html-safe-noncef7ec2ee71e217aa2c2b34762caa8ba2c06aa2cc39cd34e82ae20252b02fedb0e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0RBOjMzOUQ3NTo5RkFDNTM6REZBRDA4OjZCMDQyRkQzIiwidmlzaXRvcl9pZCI6Ijk0MzMwMDU3MjM0NDQ5NjA4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9269ce0c3a3456a63186202354688324ff5823ddf0344464d98e32126de19de0
hovercard-subject-tagissue:5762097126
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/25183/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3634fc7f13071a6e2fc36ad8715f852415fb014d1c665130a1c920d4175979d0/getsentry/sentry-javascript/issues/25183
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3634fc7f13071a6e2fc36ad8715f852415fb014d1c665130a1c920d4175979d0/getsentry/sentry-javascript/issues/25183
og:image:altPackage + version @sentry/react-router 10.55.0 (also reproduced on 11.5.0, both traceLifecycle: "static" and the default "stream"), express 4, Node 22. Description The Express layer patch ends a te...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemlavesther
hostnamegithub.com
expected-hostnamegithub.com
Noneb7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e
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
releasec3dd496c3da6ea6b77e69c09279d2b81604654f1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/25183#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25183
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%2F25183
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/25183
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25183
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25183
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues341 (341)https://github.com/getsentry/sentry-javascript/issues
Pull requests56 (56)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/25183
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25183
#25209https://github.com/getsentry/sentry-javascript/pull/25209
Express request-handler span never ends when the client aborts, dropping its subtree from the http.server transactionhttps://github.com/getsentry/sentry-javascript/issues/25183#top
#25209https://github.com/getsentry/sentry-javascript/pull/25209
https://github.com/chargome
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Expresshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Express%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
https://github.com/mlavesther
mlavestherhttps://github.com/mlavesther
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#issue-5762097126
#24854https://github.com/getsentry/sentry-javascript/pull/24854
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 Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32788478477
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#issuecomment-6060253131
Linear Codehttps://linear.app
JS-3895https://linear.app/getsentry/issue/JS-3895
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32958620703
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
Expresshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Express%22
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32788523369
https://github.com/mlavesther
mlavestherhttps://github.com/mlavesther
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#issuecomment-6060343215
chargomehttps://github.com/chargome
on Oct 8, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32798091610
chargomehttps://github.com/chargome
on Oct 9, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32864692643
fix(server-utils): End Express layer spans when the client abortshttps://github.com/getsentry/sentry-javascript/commit/818e30a38dd8833bf63263d87ebff2057ac6af17
https://docs.github.com/articles/closing-issues-via-commit-messages
818e30ahttps://github.com/getsentry/sentry-javascript/commit/818e30a38dd8833bf63263d87ebff2057ac6af17
https://github.com/chargome
chargomehttps://github.com/chargome
on Oct 9, 2026https://github.com/getsentry/sentry-javascript/issues/25183#issuecomment-6078918273
#25209https://github.com/getsentry/sentry-javascript/pull/25209
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 Oct 9, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-32865943876
chargomehttps://github.com/chargome
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#25209https://github.com/getsentry/sentry-javascript/pull/25209
on Oct 12, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-33030100490
chargomehttps://github.com/chargome
on Oct 12, 2026https://github.com/getsentry/sentry-javascript/issues/25183#event-33030100645
fix(server-utils): End Express layer spans when the client aborts (#2…https://github.com/getsentry/sentry-javascript/commit/b4bbe14db49060a9ab6824eaa3d1758ee36cf796
#2…https://github.com/getsentry/sentry-javascript/pull/25209
https://docs.github.com/articles/closing-issues-via-commit-messages
b4bbe14https://github.com/getsentry/sentry-javascript/commit/b4bbe14db49060a9ab6824eaa3d1758ee36cf796
fix(v10/server-utils): End Express layer spans when the client aborts (…https://github.com/getsentry/sentry-javascript/commit/e1b31256af0c1cc1dab16bcf0e25c08d606fee5a
…https://github.com/getsentry/sentry-javascript/pull/25256
https://docs.github.com/articles/closing-issues-via-commit-messages
e1b3125https://github.com/getsentry/sentry-javascript/commit/e1b31256af0c1cc1dab16bcf0e25c08d606fee5a
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Oct 12, 2026https://github.com/getsentry/sentry-javascript/issues/25183#issuecomment-6127326866
GitHub Actionshttps://help.github.com/en/actions
#25209https://github.com/getsentry/sentry-javascript/pull/25209
11.7.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.7.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/25183
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25183
chargomehttps://github.com/chargome
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Expresshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Express%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%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.