Skip to content

fix(replay): Adding Safety Checking for Parse Tap Event#101532

Merged
cliffordxing merged 1 commit into
masterfrom
adding-safety-check-for-tap-payload
Oct 15, 2025
Merged

fix(replay): Adding Safety Checking for Parse Tap Event#101532
cliffordxing merged 1 commit into
masterfrom
adding-safety-check-for-tap-payload

Conversation

@cliffordxing

Copy link
Copy Markdown
Contributor

The previous event_parser changes implements a new parse_tap_event function which creates a TapEvent based from the SDK. However, it seems like some outdated events are missing fields resulting in:

image

@cliffordxing cliffordxing requested a review from a team as a code owner October 15, 2025 18:15
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 15, 2025
payload_data = payload["data"]
payload_data = payload.get("data", {})
return TapEvent(
timestamp=int(payload["timestamp"]),

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.

Bug: Inconsistent Field Access Causes KeyError

The parse_tap_event function inconsistently accesses the timestamp field directly, unlike other fields that now use .get() with defaults. This can raise a KeyError if timestamp is missing from events, potentially causing crashes and defeating the purpose of the added safety checks.

Fix in Cursor Fix in Web

@codecov

codecov Bot commented Oct 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/replays/usecases/ingest/event_parser.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #101532      +/-   ##
===========================================
- Coverage   80.97%    80.97%   -0.01%     
===========================================
  Files        8706      8706              
  Lines      386874    386874              
  Branches    24516     24516              
===========================================
- Hits       313287    313284       -3     
- Misses      73236     73239       +3     
  Partials      351       351              

@cliffordxing cliffordxing merged commit 8448c57 into master Oct 15, 2025
66 checks passed
@cliffordxing cliffordxing deleted the adding-safety-check-for-tap-payload branch October 15, 2025 20:13
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants