Skip to content

fix(transaction): prefer segment_names property - #120753

Draft
mjq wants to merge 4 commits into
masterfrom
mjq/replays-segment-names-query-fe
Draft

fix(transaction): prefer segment_names property#120753
mjq wants to merge 4 commits into
masterfrom
mjq/replays-segment-names-query-fe

Conversation

@mjq

@mjq mjq commented Jul 28, 2026

Copy link
Copy Markdown
Member

Now that we have segment_names as 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.

useReplayCountForTransaction and useTransactionReplays are the main hooks to query to count and list respectively (with the list rolling in the logic from the old useReplaysFromTransaction and useReplaysWithTxData hooks, now deleted).


🤖: Heavily.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 28, 2026
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-2d4wu0ord.sentry.dev

Comment thread static/app/utils/replayCount/useReplayCountForTransaction.tsx
@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.03% 94.03% ±0%
Typed 136,587 136,607 🟢 +20
Untyped 8,670 8,670 ±0
🔍 5 new type safety issues introduced

any-typed symbols (4 new)

File Line Detail
static/app/utils/replayCount/useReplayCountForTransaction.tsx 61 spansData (var(binding))
static/app/views/performance/transactionSummary/transactionReplays/useTransactionReplays.tsx 46 locationWith90d (var)
static/app/views/performance/transactionSummary/transactionReplays/useTransactionReplays.tsx 182 slowestEvent (var)
static/app/views/performance/transactionSummary/transactionReplays/useTransactionReplays.tsx 182 slowest (param)

Type assertions (as) (1 new)

File Line Detail
static/app/utils/replayCount/useReplayCountForTransaction.tsx 41 as Array<{id: string}>(replaysData?.data ?? []) as Array<{id: string}>

This is informational only and does not block the PR.

Comment thread static/app/utils/replayCount/useReplayCountForTransaction.tsx Outdated
Comment thread static/app/utils/replayCount/useReplayCountForTransaction.tsx
@mjq

mjq commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e479061. Configure here.

}, {});

return {...replay, txEvent: slowestEvent};
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e479061. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant