fix: Fix event sorting in session replay export#392
Merged
abelonogov-ld merged 4 commits intomainfrom Feb 24, 2026
Merged
Conversation
(cherry picked from commit 463d050)
Vadman97
approved these changes
Feb 24, 2026
Merged
Vadman97
pushed a commit
that referenced
this pull request
Feb 24, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-observability-android: 0.26.1</summary> ## [0.26.1](launchdarkly-observability-android-0.26.0...launchdarkly-observability-android-0.26.1) (2026-02-24) ### Bug Fixes * Fix event sorting in session replay export ([#392](#392)) ([5e11cf7](5e11cf7)) * Touch move event buffering using wrong clock and mismatched constants ([#391](#391)) ([0a6582c](0a6582c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
abelonogov-ld
added a commit
that referenced
this pull request
Feb 27, 2026
* main: chore: release main (#396) fix: Android span e2e tests (#397) fix: improve network response capture (#379) feat: initial upload of mobile-dotnet (#393) chore: release main (#394) fix: Fix event sorting in session replay export (#392) fix: Touch move event buffering using wrong clock and mismatched constants (#391)
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.
Summary
Moved event sorting from SessionReplayExporter.export() to SessionReplayApiService.pushPayload() to fix incorrect chronological ordering of replay events.
Events were being sorted by timestamp too early in the export pipeline inside SessionReplayExporter.export(), before they were processed and grouped by session. At that stage, sorting by EventQueueItem.timestamp could reorder items in a way that broke the processing logic (e.g., an interaction event could be processed before the capture it relates to).
Note
Medium Risk
Changes the ordering of session replay events sent to the backend and makes
Event.timestampnon-nullable, which could affect payload serialization/compatibility and replay correctness if upstream producers ever omit timestamps.Overview
Fixes session replay chronological ordering by moving event sorting to the network boundary:
SessionReplayApiService.pushPayload()now sortseventsbyEvent.timestamp, andSessionReplayExporter.export()no longer sortsEventQueueItems before transforming/grouping them by session.Tightens the replay protocol model by making
ReplaySessionProtocol.Event.timestamprequired (non-null), ensuring all exported replay events can be consistently ordered. Several Android e2e tests for traces/error/span sampling/disablement are marked@Ignore, reducing CI coverage for those scenarios.Written by Cursor Bugbot for commit 04b5f93. This will update automatically on new commits. Configure here.