Skip to content

Conversation

@cliffordxing
Copy link
Contributor

As title says, this PR fixes a suspected "404 Not Found" bug that occurs when an EAP query is executed for a replay ID. The reason this is caused is likely because replay IDs are stored in hex without dashes in EAP, but the current query includes the dashes in the replay ID query, resulting in no data found.

Relates to: https://linear.app/getsentry/issue/REPLAY-824/create-query-function-for-replay-details

@cliffordxing cliffordxing requested a review from a team as a code owner November 20, 2025 23:52
@linear
Copy link

linear bot commented Nov 20, 2025

@cliffordxing cliffordxing changed the title Strip Dash Before EAP Replay Query feat(Replay): Strip Dash Before EAP Replay Query Nov 20, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 20, 2025
select=select,
where=[
Condition(Column("replay_id"), Op.IN, replay_ids),
Condition(Column("replay_id"), Op.IN, replay_ids_no_dashes),
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Missing WHERE conditions in EAP query

The EAP query is missing critical WHERE conditions for project_id and timestamp that filter results to the specified projects and time range. The function receives project_ids, start, and end parameters but doesn't use them in the query, potentially returning replays from any project and any time period instead of the requested scope. Additionally, the query lacks a HAVING clause to ensure segment_id = 0 exists, which validates replay completeness.

Fix in Cursor Fix in Web

):
# EAP stores replay_id in hex without dashes
replay_ids_no_dashes = [replay_id.replace("-", "") for replay_id in replay_ids]

Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: EAP query returns incomplete data

The EAP query selects only a subset of fields compared to the non-EAP query path, which returns all fields from QUERY_ALIAS_COLUMN_MAP when fields=[]. Critical missing fields include trace_ids, error_ids, warning_ids, info_ids, user fields, environment, tags, urls, releases, replay_type, platform, dist, duration, activity, sdk, os, browser, device, ota_updates, click fields, and viewed_by_ids. This causes the EAP endpoint to return incomplete replay details compared to the standard query path.

Fix in Cursor Fix in Web

@cliffordxing cliffordxing merged commit 1c8485a into master Nov 21, 2025
67 of 68 checks passed
@cliffordxing cliffordxing deleted the update-eap-query-bug branch November 21, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants