Skip to content

fix(remix): Prefer narrower routes over splats when both match - #23567

Open
chargome wants to merge 1 commit into
developfrom
fix/remix-route-specificity-catch-all
Open

fix(remix): Prefer narrower routes over splats when both match#23567
chargome wants to merge 1 commit into
developfrom
fix/remix-route-specificity-catch-all

Conversation

@chargome

Copy link
Copy Markdown
Member

Route specificity summed per-segment scores, so a short splat (/:lang/:*) outranked a
longer but strictly narrower route (/:lang/guides/:category/:*). Transactions for those
paths were reported under the splat route.

Specificity is now compared segment by segment, with the end of a route ranked between a
dynamic segment and a splat.

Follow-up to #23520, which fixes the same flaw in @sentry/nextjs.

Refs #23488

Route specificity summed per-segment scores, so a short splat like '/:lang/:*' outranked a
longer but strictly narrower route like '/:lang/guides/:category/:*'. Transactions for those
paths were reported under the splat route.

Compare segment by segment instead, with the first differing segment deciding. Rank the end
of a route between a dynamic segment and a splat, so that continuing into a static or dynamic
segment narrows a route while continuing into a splat widens it.

Mirrors the same fix in @sentry/nextjs.

Refs #23488
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Aug 25, 2026
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7d7dc1f. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.34 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.36 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.25 kB - -
@sentry/browser (incl. Tracing, Replay) 87.74 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.2 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.13 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.52 kB - -
@sentry/vue 35.4 kB - -
@sentry/vue (incl. Tracing) 50.32 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 48.87 kB - -
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.74 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.91 kB - -
CDN Bundle (incl. Tracing, Replay) 86.33 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94 kB - -
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.13 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.81 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.4 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.09 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 284.76 kB - -
@sentry/nextjs (client) 53.07 kB - -
@sentry/sveltekit (client) 48.76 kB - -
@sentry/core/server 64.95 kB - -
@sentry/core/browser 52.11 kB - -
@sentry/node 117.54 kB +0.02% +23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.08 kB +0.03% +24 B 🔺
@sentry/aws-serverless 91.51 kB +0.03% +20 B 🔺
@sentry/cloudflare (withSentry) - minified 196.3 kB - -
@sentry/cloudflare (withSentry) 485.93 kB - -

View base workflow run

@chargome
chargome marked this pull request as ready for review August 25, 2026 08:59
@chargome
chargome requested a review from a team as a code owner August 25, 2026 08:59
@chargome
chargome requested review from logaretm, mydea, nicohrubec and s1gr1d and removed request for a team and mydea August 25, 2026 08:59
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.

1 participant