Skip to content

feat: session replay control with sampling and state management#200

Merged
abelonogov-ld merged 5 commits into
mainfrom
andrey/new-sr-options
May 28, 2026
Merged

feat: session replay control with sampling and state management#200
abelonogov-ld merged 5 commits into
mainfrom
andrey/new-sr-options

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented May 27, 2026

  • Added isRunning property to track the current state of session replay.
  • Updated start method to accept an ignoreSampling parameter for debugging purposes.
  • Refactored isEnabled to manage session replay state more effectively.
  • Improved documentation for session replay options, including sampling behavior.

Note

Medium Risk
Changes when replay captures run (sampling) and public start/stop semantics; default sampleRate preserves prior always-on behavior but integrators must handle sampledOut and isRunning vs isEnabled.

Overview
Adds probabilistic session replay via a new sampleRate on SessionReplayOptions (default 1.0). Enabling replay or calling start() no longer guarantees capture: the service may return sampledOut and stay off until stop() resets the sampling decision.

SessionReplayStartResult and isRunning separate “enabled / attempted” from “actually recording.” start(ignoreSampling:) can force capture for debugging. LDReplay and the SessionReplay plugin now expose synchronous @MainActor start/stop with a discardable result instead of fire-and-forget Task wrappers.

README documents sampling, result handling, and the debug bypass.

Reviewed by Cursor Bugbot for commit 9d48b9b. Bugbot is set up for automated code reviews on this repo. Configure here.

- Added `isRunning` property to track the current state of session replay.
- Updated `start` method to accept an `ignoreSampling` parameter for debugging purposes.
- Refactored `isEnabled` to manage session replay state more effectively.
- Improved documentation for session replay options, including sampling behavior.
@abelonogov-ld abelonogov-ld requested a review from a team as a code owner May 27, 2026 01:55
Comment thread Sources/LaunchDarklySessionReplay/SessionReplay.swift
@abelonogov-ld abelonogov-ld changed the title feat: enhance session replay control with sampling and state management feat: session replay control with sampling and state management May 27, 2026
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) May 27, 2026 02:24
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 using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 46e6e21. Configure here.

Comment thread Sources/LaunchDarklySessionReplay/SessionReplayService.swift
@abelonogov-ld abelonogov-ld merged commit 0fc7e85 into main May 28, 2026
5 of 6 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/new-sr-options branch May 28, 2026 00:55
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 -->
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