Skip to content

fix: Fix event sorting in session replay export#392

Merged
abelonogov-ld merged 4 commits intomainfrom
andrey/fix-event-sorting
Feb 24, 2026
Merged

fix: Fix event sorting in session replay export#392
abelonogov-ld merged 4 commits intomainfrom
andrey/fix-event-sorting

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented Feb 24, 2026

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.timestamp non-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 sorts events by Event.timestamp, and SessionReplayExporter.export() no longer sorts EventQueueItems before transforming/grouping them by session.

Tightens the replay protocol model by making ReplaySessionProtocol.Event.timestamp required (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.

@abelonogov-ld abelonogov-ld requested a review from a team as a code owner February 24, 2026 21:29
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@abelonogov-ld abelonogov-ld merged commit 5e11cf7 into main Feb 24, 2026
24 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/fix-event-sorting branch February 24, 2026 22:42
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 25, 2026
…ability-sdk into andrey/mobile-dotnet

* 'andrey/mobile-dotnet' of github.com:launchdarkly/observability-sdk:
  fix: Fix event sorting in session replay export (#392)
  fix: Touch move event buffering using wrong clock and mismatched constants (#391)
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)
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.

2 participants