Skip to content

Conversation

@jerryzhou196
Copy link
Member

In #103007, I pass queryReferrer as a URL param and we lose type safety.

I want to have ReplayListQueryReferrer in a tuple rather than just a type so I can use it to convert the string URL param back to a ReplayListQueryReferrer type to be passed into a hook.

This solves a bug where some replays weren't showing for particular projects because of the incorrect queryReferrer being forwarded to useReplayList.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 17, 2025
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103433      +/-   ##
===========================================
- Coverage   80.78%    80.67%   -0.12%     
===========================================
  Files        9248      9243       -5     
  Lines      397172    394878    -2294     
  Branches    25158     25158              
===========================================
- Hits       320841    318550    -2291     
+ Misses      75884     75881       -3     
  Partials      447       447              

@jerryzhou196 jerryzhou196 marked this pull request as ready for review November 17, 2025 14:37
@jerryzhou196 jerryzhou196 requested a review from a team as a code owner November 17, 2025 14:37
Comment on lines +203 to +207
export const REPLAY_LIST_QUERY_REFERRERS = [
'replayList',
'issueReplays',
'transactionReplays',
] as const;
Copy link

Choose a reason for hiding this comment

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

Bug: The queryReferrer: 'replaysPlayList' usage is now a type mismatch because 'replaysPlayList' was removed from REPLAY_LIST_QUERY_REFERRERS.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The REPLAY_LIST_QUERY_REFERRERS constant array in static/app/views/replays/types.tsx no longer includes 'replaysPlayList'. Consequently, the derived type ReplayListQueryReferrer also excludes this value. However, the useReplayListQueryKey hook in static/app/views/replays/detail/body/replayDetailsProviders.tsx at line 75 still attempts to use queryReferrer: 'replaysPlayList'. This results in a TypeScript compilation error and build failure due to a type mismatch, as 'replaysPlayList' is no longer a valid ReplayListQueryReferrer.

💡 Suggested Fix

Update the queryReferrer value in static/app/views/replays/detail/body/replayDetailsProviders.tsx to one of the valid ReplayListQueryReferrer values, or re-add 'replaysPlayList' to REPLAY_LIST_QUERY_REFERRERS if its usage is intended.

🤖 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: static/app/views/replays/types.tsx#L203-L207

Potential issue: The `REPLAY_LIST_QUERY_REFERRERS` constant array in
`static/app/views/replays/types.tsx` no longer includes `'replaysPlayList'`.
Consequently, the derived type `ReplayListQueryReferrer` also excludes this value.
However, the `useReplayListQueryKey` hook in
`static/app/views/replays/detail/body/replayDetailsProviders.tsx` at line 75 still
attempts to use `queryReferrer: 'replaysPlayList'`. This results in a TypeScript
compilation error and build failure due to a type mismatch, as `'replaysPlayList'` is no
longer a valid `ReplayListQueryReferrer`.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2742267

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.

2 participants