Skip to content

feat(session-replay): add user input events to replay recordings - #2288

Merged
tustanivsky merged 3 commits into
masterfrom
feat/replay-input-events
Nov 9, 2026
Merged

tustanivsky merged 3 commits into
masterfrom
feat/replay-input-events

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

This PR lets SDKs embedding sentry-native add user input (mouse moves, clicks, touches) to session replays, so the replay player shows it on top of the video as it does for the web and mobile SDKs.

The replay sidecar may now carry an optional inputEvents array of rrweb events whose timestamp is in milliseconds since the first video frame. sentry__session_replay_flush_pending embeds them into the replay_recording payload next to the breadcrumb events.

Key changes

  • append_input_events keeps the object entries of inputEvents that fall inside the clip (0 <= timestamp <= durationMs) and moves their timestamp onto the replay start (start_sec), so they stay in sync with the video. The events are otherwise passed through unchanged: the SDK doesn't read their type or data, so new rrweb event kinds need no SDK change.
  • Breadcrumb and input events are now built into separate lists and merged by timestamp, so the recording stays in chronological order.
  • Sidecars without inputEvents produce the same recording as before.

Testing

  • stage_replay adds input events to the staged sidecar: two inside the clip, one past its end. The shared replay-envelope assertion checks that only the two inside the clip are embedded, moved onto the replay start, and in timestamp order next to the breadcrumbs. This covers the existing replay integration tests for the crashpad, breakpad, inproc and native daemon backends.

Related Items

Reads the optional inputEvents array from the replay sidecar, keeps the events that fall inside the clip, rebases their timestamps (ms since the first video frame) onto the replay start, and merges them with the breadcrumb events in timestamp order.
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against d138742

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.67%. Comparing base (cfa77a5) to head (d138742).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2288      +/-   ##
==========================================
+ Coverage   75.62%   75.67%   +0.05%     
==========================================
  Files         104      104              
  Lines       28397    28439      +42     
  Branches     5213     5220       +7     
==========================================
+ Hits        21476    21522      +46     
+ Misses       5575     5558      -17     
- Partials     1346     1359      +13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tustanivsky
tustanivsky marked this pull request as ready for review November 9, 2026 12:23
@tustanivsky
tustanivsky requested review from JoshuaMoelans, jpnurmi and mujacica and removed request for jpnurmi November 9, 2026 12:55
@tustanivsky
tustanivsky merged commit 8b6137d into master Nov 9, 2026
70 checks passed
@tustanivsky
tustanivsky deleted the feat/replay-input-events branch November 9, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants