Skip to content

chore: Identify API for MAUI refactor#156

Merged
abelonogov-ld merged 13 commits intomainfrom
andrey/sr-hookproxy
Mar 19, 2026
Merged

chore: Identify API for MAUI refactor#156
abelonogov-ld merged 13 commits intomainfrom
andrey/sr-hookproxy

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented Mar 18, 2026

Make architecture more iOS standard ( delegate )


Note

Medium Risk
Refactors the identify hook/bridge path to call into SessionReplayService via a new delegate method, which could affect when/if identify events are emitted. Risk is limited to session-replay observability behavior (no auth/payment changes) but touches cross-platform bridge code.

Overview
Refactors Session Replay’s identify handling so both the native SDK hook and the MAUI/C# bridge proxy delegate directly to SessionReplayService.afterIdentify(...), instead of constructing identify payloads inside SessionReplayHook/SessionReplayHookProxy.

LDReplay.hookProxy is now a computed property derived from the current client, and SessionReplay reuses a single SessionReplayHook instance with a weak delegate. SessionReplayService now retains observabilityContext and owns the identify payload creation/scheduling.

Minor updates include conditional Common imports for non-CocoaPods builds, a formatting fix in InitializeSessionOperation, and enabling crashReporting in the test app’s Observability plugin options.

Written by Cursor Bugbot for commit 01a088d. This will update automatically on new commits. Configure here.

Squashed commits:
[bd9564d] res attr
* main:
  chore(main): release 0.24.0 (#151)
  feat: pod specs (#150)
  chore: update podspecs for observability and session replay (#148)
* main:
  feat: Identify Proxy, Record and Logs for MAUI (#149)
* main:
  chore(main): release 0.26.0 (#154)
  feat: cocoapods support for session replay (#153)
  chore(main): release 0.25.0 (#152)
* main:
  chore(main): release 0.26.1 (#160)
  chore: test app memory leaks (#158)
  fix: make iOS requests recognized by backend (#159)
  chore: Dialogs examples in TestApp (#157)

# Conflicts:
#	TestApp/Sources/AppDelegate.swift
@abelonogov-ld abelonogov-ld changed the title feat: Identify API for MAUI feat: Android Identify API for MAUI Mar 19, 2026
@abelonogov-ld abelonogov-ld changed the title feat: Android Identify API for MAUI chore: Android Identify API for MAUI Mar 19, 2026
@abelonogov-ld abelonogov-ld changed the title chore: Android Identify API for MAUI chore: Identify API for MAUI refactor Mar 19, 2026
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.

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.

public var hookProxy: SessionReplayHookProxy?
public var hookProxy: SessionReplayHookProxy? {
client.map { SessionReplayHookProxy(sessionReplayService: $0) }
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Computed hookProxy creates new instance on every access

Medium Severity

The hookProxy property changed from a stored property to a computed property, meaning every access allocates a new SessionReplayHookProxy (an NSObject subclass) instead of returning a cached instance. This is particularly wasteful for the C#/MAUI bridge, where each call like LDReplay.shared.hookProxy?.afterIdentify(...) creates a throwaway object. The sibling LDObserve.shared.hookProxy remains a stored property set once in getHooks(), making this inconsistent across the two plugins.

Fix in Cursor Fix in Web

@abelonogov-ld abelonogov-ld merged commit a49721b into main Mar 19, 2026
6 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/sr-hookproxy branch March 19, 2026 17:26
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