Repository navigation
fix(cli): Add replay and segment IDs to sentry local replay records - #2483
Conversation
Every segment of a session replay carries the replay ID as its event_id, so NDJSON replay records could not be told apart or tied to a replay. replay_event and replay_recording records now carry replay_id and segment_id. The tail still prints one line per replay, as #2389 meant, and that line now names the segment it started from. Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The tail's replay line never updates, so `[segment 0]` read like only segment 0 had arrived. It now says `[from segment N]`. Recordings that the receiver keeps as text, for a text content type, now keep their segment number in JSON too, and the replay segment number check is shared with the event lookup. Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
…ents # Conflicts: # packages/cli/src/commands/local/control-plane.ts
MathurAditya724
left a comment
There was a problem hiding this comment.
Reviewed updated head 90dead4 integrated with current main. Junior resolved the shared import conflict while review was running; the updated integration tree is byte-for-byte identical to the tree that passed local typecheck, lint and the full workspace test suite. No actionable findings. Independent offline wire QA through the actual CLI covered outer-gzip envelopes, binary recording bodies containing gzip rrweb bytes, text recording bodies, and multiple segments sharing one replay ID. All five JSON records had the exact replay/segment IDs; all three envelopes per run remained retained; human output printed exactly one replay line with the starting segment. Fresh hosted checks and review threads were checked on this head before merge.
A browser replay sends a new segment every few seconds. In
--format json, each segment's records only had the replay ID asevent_id, with no segment number, so you couldn't tell them apart or count them. The human tail printed one line for the whole replay, which looked like only segment 0 had arrived.Replay records (
replay_eventandreplay_recording) now includereplay_idandsegment_id. The recording's segment number comes from its first line, whether the receiver kept it as base64 or as text.The human tail still prints one line per replay. That was on purpose in #2389: printing every segment would add a line every ~5s and bury errors and logs. The tail can't edit a line it already printed, and agents often read it through a pipe, so a live counter isn't an option either. The line now says which segment the tail joined at (
from segment N, usually 0), and the docs point tolocal event listand--format jsonfor every segment.From a React app with session replay, segment 1 of its replay:
via @MathurAditya724.
--
View Session [Sentry]