feat(session-replay): embed sessionId at creation time in push event payloads#189
Merged
Conversation
…payloads Attach sessionId to IdentifyItemPayload, ImageItemPayload, TouchInteraction, and PressInteraction at object creation time rather than at export time. Injects a @sendable () -> String sessionIdProvider closure through InputCaptureCoordinator and CaptureManager so each interaction and frame captures the live session ID the moment it is created, correctly tracking session rotations that occur while capture is running continuously. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updated TouchSample to include a sessionId parameter at initialization, ensuring that the session ID is captured at the time of touch event creation. Adjusted TouchInterpreter to utilize the sessionId from TouchSample, streamlining the processing of touch interactions.
… for efficiency Moved the sessionId retrieval outside of the touch event loop in InputCaptureCoordinator to enhance performance and maintainability. This change ensures that the sessionId is captured once per event rather than multiple times during iteration.
…ouch events Moved the sessionId retrieval outside of the touch event loop in InputCaptureCoordinator to improve efficiency. This change ensures that the sessionId is captured once per event, enhancing performance and maintainability.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0d23f7a. Configure here.
abelonogov-ld
approved these changes
May 27, 2026
abelonogov-ld
pushed a commit
that referenced
this pull request
May 28, 2026
🤖 I have created a release *beep* *boop* --- ## [0.36.0](0.35.0...0.36.0) (2026-05-28) ### Features * session replay control with sampling and state management ([#200](#200)) ([0fc7e85](0fc7e85)) * **session-replay:** embed sessionId at creation time in push event payloads ([#189](#189)) ([cafefbf](cafefbf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mechanical version and changelog updates with no runtime code changes in this PR. > > **Overview** > Bumps the monorepo release from **0.35.0** to **0.36.0** across Release Please (`release-please-manifest.json`), **CHANGELOG** (new `0.36.0` section), CocoaPods specs (`LaunchDarklyObservability`, `LaunchDarklySessionReplay`), and `sdkVersion` in `Version.swift`. > > The changelog entries for this release (not modified in this diff beyond being added) document **session replay control** (sampling and state management) and **sessionId embedded at push event creation** for session replay payloads. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fd5aad6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Attach sessionId to IdentifyItemPayload, ImageItemPayload, TouchInteraction, and PressInteraction at object creation time rather than at export time.
Injects a @sendable () -> String sessionIdProvider closure through InputCaptureCoordinator and CaptureManager so each interaction and frame captures the live session ID the moment it is created, correctly tracking session rotations that occur while capture is running continuously.
Note
Medium Risk
Changes how session replay batches attribute events across session boundaries; incorrect wiring could mis-route payloads, but scope is observability/replay data paths rather than auth or secrets.
Overview
Session replay and UI interaction events now carry
sessionIdwhen each payload is created, instead of relying on the exporter’s current session at push time.SessionManagingexposes asessionIdProviderclosure;InputCaptureCoordinatorandCaptureManagercall it when touches, presses, and frames are captured (main thread for UI).TouchInteraction,PressInteraction,IdentifyItemPayload, andImageItemPayloadall store that id and pass it through interpreters and the event queue.UserInteractionManagerandSessionReplayServicewire the provider fromsessionManager.This keeps replay events aligned with the session that was active when the user acted or the frame was taken, including background timeout session resets while capture keeps running.
Reviewed by Cursor Bugbot for commit ba192eb. Bugbot is set up for automated code reviews on this repo. Configure here.