feat(flutter): configurable Session Replay capture scale#626
Open
abelonogov-ld wants to merge 13 commits into
Open
feat(flutter): configurable Session Replay capture scale#626abelonogov-ld wants to merge 13 commits into
abelonogov-ld wants to merge 13 commits into
Conversation
Wire OTLP_ENDPOINT and BACKEND_URL dart-defines through to ObservabilityOptions in the example app, mirroring otlpEndpoint / backendUrl in the Swift sample's Secrets.xcconfig. Empty/unset defines fall back to the production defaults baked into the SDK. Documents the optional keys in the example README and dart_defines template. Co-authored-by: Cursor <cursoragent@cursor.com>
* main: chore: release main (#623)
…chdarkly/observability-sdk into andrey/flutter-otlp-endpoint-config * 'andrey/flutter-otlp-endpoint-config' of github.com:launchdarkly/observability-sdk:
Add `SessionReplayOptions.scale` (double?, default 1.0 = 1x / 160 DPI) and thread it through the Pigeon schema, codec, and native bridges on both platforms. The Flutter capture service now renders frames at the configured scale instead of the full device pixel ratio, so capture resolution matches the scale recorded by the native Session Replay exporter (fixes oversized replay frames). Resolves scale once in each LDNativeApiImpl so the exporter options and the Flutter capture service stay in sync. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 77fadde. Configure here.
A missing or non-positive `scale` made the native exporter record the raw (possibly 0/negative) value while the Dart capture fell back to the device pixel ratio, reintroducing the capture/exporter scale mismatch. Resolve a missing or `<= 0` scale to the 1.0 default on both Android and iOS so the exporter options and the over-the-channel capture scale always agree. Also fixes an ambiguous `CGFloat.init` function reference on iOS by using an explicit closure for the scale conversion. Co-authored-by: Cursor <cursoragent@cursor.com>
…r-sr-scale * andrey/flutter-otlp-endpoint-config: update ver bump dependencies feat(flutter): allow overriding OTLP endpoint and backend URL in example
Vadman97
approved these changes
Jun 15, 2026
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
scaleto the FlutterSessionReplayOptions(double?, default1.0= 1x / 160 DPI) — a capture-resolution multiplier (2.0= 2x, etc.).nullis treated as1.0.scalethrough the Pigeon schema (messages.dart+ regeneratedmessages.g.*), the native options codec, and both native bridges (LDNativeApiImplfor Android/iOS).scaleinstead of the full device pixel ratio. Previously frames were captured at full DPR (e.g. 3x on a typical phone), producing oversized replay frames that didn't match the scale recorded by the native exporter.LDNativeApiImplresolvesscaleonce and passes the same value to both the native exporter options (ReplayOptions/SessionReplayOptions) and the Flutter capture service, keeping capture resolution and exported metadata in sync.nullpropagation).Behavior note
Default
scaleis1.0, so frames now capture at 1x by default instead of full device DPR. This makesscale: 1mean 160 DPI / 1x as expected. Setscale: 2.0for sharper replays.Cross-repo dependency
The iOS bridge passes
scaleinto the nativeSessionReplayOptions, which requires the native scale support in launchdarkly/swift-launchdarkly-observability#223. That PR must land and ship in a new swift-launchdarkly-observability release, and the iOS dependency (podspec / Package.swift) bumped to it, before the iOS side builds against a published version. Android scale support already exists inobservability-androidin this repo.Test plan
dart analyze+dart formatpassflutter testpasses (codec tests included)scaleare 1x / 160 DPI;scale: 2.0captures at 2xscaleare 1x;scale: 2.0captures at 2xMade with Cursor