Uh oh!
There was an error while loading. Please reload this page.
feat(solid): Set url attributes on solid router and tanstack router spans - #22090
Conversation
size-limit report 📦
|
e595d12 to
d6abd79Comparea518d21 to
1d77c34Compared6abd79 to
ee4514cCompare1d77c34 to
6c98bbbCompareUh oh!
There was an error while loading. Please reload this page.
6c98bbb to
6190c45Compareee4514c to
0002c1fCompare6190c45 to
6c98bbbCompare0002c1f to
ee4514cCompare6c98bbb to
6190c45Compareee4514c to
0002c1fCompareUh oh!
There was an error while loading. Please reload this page.
0002c1f to
ee4514cCompare6190c45 to
6c98bbbCompareee4514c to
b276e49Compare8d16900 to
3aea408Comparea6eb9e5 to
d262ae6Compare3aea408 to
377e8a8CompareUh oh!
There was an error while loading. Please reload this page.
1442f98 to
fe7157eComparecc1771f to
c62961fComparefe7157e to
c49062dCompareUh oh!
There was an error while loading. Please reload this page.
c49062d to
189260bComparec62961f to
f476dfcCompare189260b to
c80aa1cComparef476dfc to
cfa4176CompareUh oh!
There was an error while loading. Please reload this page.
cfa4176 to
ef79aedComparec80aa1c to
1139cf9Comparea8ecb5c to
92e0d28Comparee843e31 to
1ccda07CompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…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
cf15b60CompareUh oh!
There was an error while loading. Please reload this page.
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