feat: MAUI integration hooks and refactor for 0.4.1 nuget#425
feat: MAUI integration hooks and refactor for 0.4.1 nuget#425abelonogov-ld wants to merge 47 commits intomainfrom
Conversation
* main: feat: Optional Jet Compose (#402) feat: Android Incremental Image Diff compression (#390) chore: add CLAUDE.md (#398) chore: release main (#400) fix: correct react native session replay build step (#399) chore: release main (#396) fix: Android span e2e tests (#397) fix: improve network response capture (#379) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/.vscode/tasks.json
* main: chore: release main (#401)
(cherry picked from commit 9901600)
* andrey/hooks: comment identify stuff fat working working can launch
* main: fix: ldclient dependencies (#407)
* main: chore: release main (#419) feat: Use C and NEON for hashing (Optimization) 100x on Pixel 8 (#415) chore: release main (#418) feat: Android SR use Jpeg 0.3 quality (#417) chore: release main (#411) feat: CPU utilization optimization in image diff calculations (#414) fix: reset nodeIds during fullsnapshot (#412) chore: Android benchmark screen of SR data pipelines on iOS Raw Frames (#410) feat: Android Observability hook proxy for MAUI (#409) feat: ruby observability plugin (#360) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/android/native/LDObserve/src/main/java/com/example/LDObserve/ObservabilityBridge.kt # sdk/@launchdarkly/mobile-dotnet/macios/native/LDObserve/Sources/ObservabilityBridge.swift # sdk/@launchdarkly/mobile-dotnet/observability/LDAPI/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj # sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/bridge/NativeHookProxy.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/api/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityHook.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityPlugin.cs # sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayHook.cs # sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayPlugin.cs # sdk/@launchdarkly/mobile-dotnet/sample/MauiProgram.cs
* main: feat: mobile-dotnet support init attributes (#420) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj # sdk/@launchdarkly/mobile-dotnet/observability/bridge/DictionaryTypeConverters.cs
...ty-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/SessionReplayService.kt
Outdated
Show resolved
Hide resolved
...ib/src/main/kotlin/com/launchdarkly/observability/replay/exporter/SessionReplayApiService.kt
Outdated
Show resolved
Hide resolved
...ty-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/SessionReplayService.kt
Show resolved
Hide resolved
...ability-android/lib/src/main/kotlin/com/launchdarkly/observability/sdk/AttributeConverter.kt
Show resolved
Hide resolved
e2e/android/app/src/main/java/com/example/androidobservability/BaseApplication.kt
Show resolved
Hide resolved
.../lib/src/main/kotlin/com/launchdarkly/observability/replay/exporter/SessionReplayExporter.kt
Show resolved
Hide resolved
(cherry picked from commit a56660e)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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.
| // put wake up in the try/catch do not break buffering logic | ||
| logger.error(e) | ||
| } | ||
| } |
There was a problem hiding this comment.
shouldWakeUpSession not restored during export rollback
Medium Severity
The export method snapshots and restores lastCaptureState, payloadIdCounter, pushedCanvasSize, and eventGenerator state on failure, but shouldWakeUpSession is not included. If wakeUpEvents succeeds (setting shouldWakeUpSession = false) but a subsequent session's pushPayload throws, the outer catch rolls back all other state while shouldWakeUpSession stays false. On retry, wake-up events are never re-sent and the rolled-back payloadIdCounter reuses IDs that the already-sent wake-up events consumed.


Summary
Refactors the Android Observability SDK architecture to align with the iOS/Swift and MAUI integration patterns, decoupling the
Observabilityplugin fromSessionReplayso each can function independently.Architectural Changes
SessionReplayServicecan depend onObservability, butObservabilityno longer depends onSessionReplay. RemovedInstrumentationContributor,InstrumentationContributorManager, and theLDExtendedInstrumentation-based registration flow.ReplayInstrumentation→SessionReplayService,ReplayControl→SessionReplayServicing.RoutingLogRecordProcessorand the per-instrumentation log routing mechanism fromInstrumentationManager, since it was only used by session replay and no longer needed.InstrumentationManagernow captures the OTelSessionManagervia a lightweight bridgeAndroidInstrumentationand exposes it throughObservabilityClient→ObservabilityContext.sessionManager, matching the Swift pattern.Session Replay Changes
SessionReplay.register()directly createsSessionReplayServiceusingLDObserve.context, wires it toLDReplay, and sets the hook delegate.SessionReplay.onPluginsReady()callssessionReplayService.initialize()afterSessionManageris available.SessionReplayHookno longer holds a reference to theSessionReplayplugin. Instead, it uses a@Volatiledelegate of typeSessionReplayServicingand extracts context keys from SDK types before delegating.afterIdentifymoved to service layer: Context key extraction andLDContextbuilding now happen inSessionReplayService.afterIdentify()andSessionReplayHook.afterIdentify()respectively, using aMap<String, String>interface for cross-platform compatibility.SessionReplayHookProxy: JVM adapter for the C#/MAUI bridge that accepts simple JVM types and delegates toSessionReplayServicing.RRWebEventGenerator.generateWakeUpEvents()andSessionReplayExporter.wakeUpEvents()to re-trigger player playback after session resumption with a reload event and synthetic mouse interactions.RRWebEventGeneratornow accepts atitleparameter used in reload custom events, derived from the application name.New Utilities
AttributeConverter: Converts untypedMap<String, Any?>dictionaries (from bridge layers like .NET MAUI) into OTelAttributes, with support for nested map flattening via dot-separated keys and typed list handling.Note
Medium Risk
Refactors plugin wiring and session replay export behavior (session manager capture, identify flow, and extra payload pushes), which can impact initialization order and replay delivery if assumptions differ across apps.
Overview
Refactors the Android Observability + Session Replay integration to remove the old
InstrumentationContributor/InstrumentationContributorManager+LDExtendedInstrumentationregistration path, and instead capture/expose the OTelSessionManagervia anAndroidInstrumentationbridge (ObservabilityClient.sessionManager→ObservabilityContext.sessionManager). The log pipeline inInstrumentationManageris simplified by dropping per-instrumentation log routing.Session Replay is reworked around a standalone
SessionReplayService(ReplayInstrumentation→SessionReplayService,ReplayControl→SessionReplayServicing): theSessionReplayplugin now constructs the service directly, initializes it ononPluginsReady(), and routes SDK identify events through a delegate-basedSessionReplayHookplus a new bridge-friendlySessionReplayHookProxy/LDReplay.hookProxy. Replay exporting adds apptitlepropagation, setsclient_id, sends identify events even when session id is missing by falling back to the last capture session, and may emit an additional “wake-up” payload (reload + synthetic interactions) to resume playback.Adds
AttributeConverterandLDObserveoverloads to accept MAUI-friendlyMap<String, Any?>attributes and severity numbers without exposing OpenTelemetry types. Also includes small demo app UI tweaks (Session Replay header/toggle) and updated tests for the new wiring and extra replay payload.Written by Cursor Bugbot for commit b79b772. This will update automatically on new commits. Configure here.