Skip to content

ref(replays): Use generic /events/ endpoint in useReplayData#113346

Open
mjq wants to merge 2 commits intomasterfrom
mjq/ref/replay-events-meta-use-generic-events
Open

ref(replays): Use generic /events/ endpoint in useReplayData#113346
mjq wants to merge 2 commits intomasterfrom
mjq/ref/replay-events-meta-use-generic-events

Conversation

@mjq
Copy link
Copy Markdown
Member

@mjq mjq commented Apr 17, 2026

The replay-specific /replays-events-meta/ endpoint exists to bypass the cross-project gate the generic events endpoints used to enforce. That gate was removed when the organizations:global-views flag was retired (#98684), so the replay clone is no longer needed.

  • Point useReplayData at /events/ with an explicit field list covering the columns the replay endpoint used to hardcode, plus project.name.
  • timestamp_ms is now consumed by the hook directly: hydrateErrors normalizes Snuba's non-ISO "YYYY-MM-DD HH:MM:SS.sss" shape before constructing the Date so ms precision survives.
  • onRetry narrows its cache invalidation via a predicate on referrer=replay_details so unrelated /events/ queries aren't refetched.
  • Change the dataset from DISCOVER to ERRORS - it was already using ERRORS behind the scenes, but this makes it explicit (so it can't be confused for a TRANSACTIONS dataset usage, which is deprecated.)

The backend endpoint can be cleaned up after this goes out.

Fixes DAIN-1459.

The replay-specific /replays-events-meta/ endpoint exists to bypass the
cross-project gate the generic events endpoints used to enforce. That
gate was removed when the organizations:global-views flag was retired
(PR #98684), so the replay clone is no longer needed.

Point useReplayData at OrganizationEventsEndpoint (/events/) with an
explicit `field` list covering the columns the replay endpoint used to
hardcode, plus project.name. timestamp_ms is now consumed by the hook
directly: hydrateErrors normalizes Snuba's non-ISO
"YYYY-MM-DD HH:MM:SS.sss" shape before constructing the Date so ms
precision survives. onRetry narrows its cache invalidation via a
predicate on referrer=replay_details so unrelated /events/ queries
aren't refetched.

Note that the dataset changed from `DISCOVER` to `ERRORS` - it was already
using `ERRORS` behind the scenes, but this makes it explicit (so it can't be
confused for a TRANSACTIONS usage, which is deprecated.)

The backend endpoint can be cleaned up after this goes out.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 17, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 17, 2026

Comment thread static/app/utils/replays/hydrateErrors.tsx
cursor[bot]

This comment was marked as resolved.

@mjq mjq marked this pull request as ready for review April 17, 2026 19:45
@mjq mjq requested a review from a team as a code owner April 17, 2026 19:45
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we throw til up into static/utils/date/* maybe? it's date transforms, nothing replay specific.

i bet other places do something similar already, so finding a shared home for all that could create re-use in the future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, will do before merge!

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