feat(solid): Set url attributes on solid router and tanstack router spans#22090
Conversation
size-limit report 📦
|
e595d12 to
d6abd79
Compare
a518d21 to
1d77c34
Compare
d6abd79 to
ee4514c
Compare
1d77c34 to
6c98bbb
Compare
6c98bbb to
6190c45
Compare
ee4514c to
0002c1f
Compare
6190c45 to
6c98bbb
Compare
0002c1f to
ee4514c
Compare
6c98bbb to
6190c45
Compare
ee4514c to
0002c1f
Compare
0002c1f to
ee4514c
Compare
6190c45 to
6c98bbb
Compare
ee4514c to
b276e49
Compare
8d16900 to
3aea408
Compare
a6eb9e5 to
d262ae6
Compare
3aea408 to
377e8a8
Compare
d262ae6 to
1442f98
Compare
1442f98 to
fe7157e
Compare
cc1771f to
c62961f
Compare
fe7157e to
c49062d
Compare
c49062d to
189260b
Compare
c62961f to
f476dfc
Compare
189260b to
c80aa1c
Compare
f476dfc to
cfa4176
Compare
cfa4176 to
ef79aed
Compare
c80aa1c to
1139cf9
Compare
a8ecb5c to
92e0d28
Compare
e843e31 to
1ccda07
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 92e0d28. Configure here.
…pans Adds url.template, url.path, and url.full to pageload and navigation spans for Solid Router and TanStack Solid Router, including redirect and back-button navigation cases. Updates solidstart and solid-tanstack-router e2e tests. part of #21921 Co-Authored-By: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
92e0d28 to
cf15b60
Compare
Guard the pageload `onResolved` handler so it only overwrites the span when a redirect resolves to a real route match, and always write `url.template` in `applyRouteMatch` so a stale parameterized template is cleared once a redirect hop lands on an unmatched path. Previously a redirect chain could downgrade a route-based span to `sentry.source: url` while keeping a stale `url.template`, misgrouping performance data. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
| applyRouteMatch(span, resolvedMatch, toLocation, WINDOW.location?.pathname || toLocation.pathname); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Bug: The onResolved handler for navigation spans doesn't call applyRouteMatch for unmatched routes, preventing url.path and url.full attributes from being set on the span.
Severity: MEDIUM
Suggested Fix
Modify the onResolved handler for navigation spans. The applyRouteMatch function should be called even when resolvedMatch is undefined to ensure URL attributes are set correctly for unmatched routes. This could be done by moving the call outside the if (resolvedMatch) block or adjusting the logic to handle both matched and unmatched cases.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/solid/src/tanstackrouter.ts#L154-L156
Potential issue: In the `onResolved` handler for navigation spans, a conditional check
`if (resolvedMatch)` prevents `applyRouteMatch` from executing when a navigation
resolves to a path without a matching route. While `applyRouteMatch` is designed to
handle this case by setting span attributes like `url.path` and `url.full`, the guard
prevents it from running. Consequently, navigation spans for unmatched routes (e.g., a
404 page) will be missing these important URL attributes, unlike pageload spans where
similar behavior is intentional.

Adds
url.template,url.path, andurl.fullto pageload and navigation spans for Solid Router and TanStack Solid Router integrations, including redirect and back-button navigation cases.Ports
locationToSpanUrlAttributesfrom the React TanStack Router integration and updates Solid Router to pass the destination URL when starting navigation spans. Includes e2e test coverage for solidstart and solid-tanstack-router.part of #21921
Made with Cursor