fix(transaction): prefer segment_names property - #120753
Conversation
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-2d4wu0ord.sentry.dev |
📊 Type Coverage Diff
🔍 5 new type safety issues introduced
Type assertions (
This is informational only and does not block the PR. |
cc04345 to
b09674e
Compare
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e479061. Configure here.
| { | ||
| query: { | ||
| field: REPLAY_LIST_FIELDS, | ||
| per_page: REPLAYS_LIMIT, |
There was a problem hiding this comment.
Invalid replay list field names
High Severity
fetchReplays passes REPLAY_LIST_FIELDS as field, including nested names like browser.name and os.name. The replays API only accepts root fields such as browser and os, so this request is rejected and the transaction Replays tab fails to load. Existing helpers already strip compound fields before calling this endpoint.
Reviewed by Cursor Bugbot for commit e479061. Configure here.
| }, {}); | ||
|
|
||
| return {...replay, txEvent: slowestEvent}; | ||
| }); |
There was a problem hiding this comment.
Incomplete slowest transaction enrichment
Medium Severity
Enrichment only uses the limited transactions sample fetched for fallback IDs. Replays returned solely via segment_names often have no matching event in that sample, so txEvent stays empty and the Slowest Transaction column is blank. Previously every listed replay came from that transactions query, so enrichment always had a match.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e479061. Configure here.


Now that we have
segment_namesas a queryable property on Replays, use it from the transaction summary for the replay list and count.This is the more accurate search than the old two-step query to get replay IDs from spans, then check whether or not the replays actually exist.
useReplayCountForTransactionanduseTransactionReplaysare the main hooks to query to count and list respectively (with the list rolling in the logic from the olduseReplaysFromTransactionanduseReplaysWithTxDatahooks, now deleted).🤖: Heavily.