Skip to content

feat: MAUI API revamp#573

Open
abelonogov-ld wants to merge 10 commits into
mainfrom
andrey/maui-independent
Open

feat: MAUI API revamp#573
abelonogov-ld wants to merge 10 commits into
mainfrom
andrey/maui-independent

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

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

Summary

  • Adds the new LDObserve.Init(...) API format with two entry points:
    • LDObserve.Init(mobileKey, observabilityOptions, sessionReplayOptions) for standalone initialization.
    • LDObserve.Init(client, observabilityOptions, sessionReplayOptions) for LaunchDarkly client-backed initialization.
  • Consolidates observability and session replay under a single ObservabilityPlugin, removing the separate session replay plugin and the fragile plugin orchestrator.
  • Updates the sample app and README to use explicit ObservabilityOptions and optional SessionReplayOptions instead of registering plugins through PluginConfigurationBuilder.

Details

  • LDNative is now internal and called through LDObserve.Init.
  • SessionReplayOptions is optional; when omitted, replay is not wired up.
  • Standalone initialization now wires the LDObserve facade so RecordLog, metrics, spans, and errors work without an LdClient.
  • HTTP activity propagation is centralized in ObservabilityService, so network tracing is enabled consistently across both initialization paths.
  • README examples now show the new client and standalone setup formats, including session replay privacy and instrumentation options.

Testing

  • Verified edited files with IDE lints.
  • Manually reviewed the sample initialization path for both standalone and LdClient variants.
  • Full MAUI/iOS/Android build not run in this session.

Note

Medium Risk
Public MAUI initialization API and plugin registration change (breaking for integrators on the old dual-plugin pattern); native init parameter renames affect multiple bindings but are mechanical.

Overview
The .NET MAUI observability package moves to a single LDObserve.Init entry point instead of registering separate ObservabilityPlugin / SessionReplayPlugin on LdClient. Init(mobileKey, …) starts the native stack without a feature-flag client; Init(client, …) registers one combined ObservabilityPlugin that boots native code and wires observability + replay hooks. PluginOrchestrator, SessionReplayPlugin, and INativePlugin are removed; LDReplay.IsEnabled replaces sample MauiProgram.LdNative for toggling replay.

Native LDObserve.init call sites (Android e2e, Flutter, MAUI bridge) rename parameters from options/replayOptions to observability/replay. Docs and the sample app follow the new API; package version bumps to 0.11.0 and LaunchDarkly.ClientSdk to [5.8.0, 6.0.0); iOS binding sets SupportedOSPlatformVersion 15.0.

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

@abelonogov-ld abelonogov-ld requested a review from a team as a code owner May 29, 2026 14:44
@abelonogov-ld abelonogov-ld changed the title feat: MAUI independent from ldclient API feat: MAUI independent from LDClient API May 29, 2026
@abelonogov-ld abelonogov-ld changed the title feat: MAUI independent from LDClient API feat: MAUI API independent from LDClient May 29, 2026
@abelonogov-ld abelonogov-ld changed the title feat: MAUI API independent from LDClient feat: MAUI API revamp May 29, 2026
Comment thread sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDNative.cs Outdated
Comment thread sdk/@launchdarkly/mobile-dotnet/observability/replay/api/LDReplay.cs Outdated
Copy link
Copy Markdown
Contributor

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

should this be a feat! major bump? or are we still on 0.x, then we are ok

Comment thread sdk/@launchdarkly/mobile-dotnet/sample/MauiProgram.cs Outdated
…ervability-sdk into andrey/maui-independent

* 'andrey/maui-independent' of github.com:launchdarkly/observability-sdk:
  feat: Android SR options frameRate to match with iOS (#572)
  fix: triggering Ruby CI on Android/Dotnet changes (#571)
Comment thread sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDNative.cs Outdated
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) May 29, 2026 23:30
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 79aae6e. Configure here.

bridge.Start(mobileKey, observability, replay, observabilityVersion);
#endif

LDReplay.OnNativeStarted(ldNative.Replay);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pre-init buffer applies pending value after native bridge starts

Medium Severity

LDReplay.OnNativeStarted (which calls Bind to apply buffered IsEnabled writes) is invoked AFTER bridge.Start has already consumed the replay options. On Android, options are converted via ToNative() before Bind runs, so pending values never reach native. On iOS, the bridge reads initial values during Start. A user who sets LDReplay.IsEnabled = false before init expects native replay to start disabled, but the native layer starts with the original value because Bind applies too late.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 79aae6e. Configure here.

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