Commit b6ec2b1
authored
fix(react-native): propagate afterIdentify propagation in iOS session replay (#501)
## Summary
Propagate afterIdentify to session replay in iOS the same as Android.
## How did you test this change?
Manually ran the example app and verified the session replay shows up as
desired.
## Are there any deployment considerations?
N/A
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches iOS session replay initialization and context propagation;
incorrect context building or ordering could affect user attribution in
replays, but scope is limited to the adapter layer and adds defensive
error handling.
>
> **Overview**
> Aligns iOS with Android by wiring `afterIdentify` through the React
Native session replay bridge to the native SDK hook, and caching the
latest identified `LDContext`.
>
> `SessionReplayClientAdapter` now builds single- and multi-kind
contexts from the `[kind: key]` map, updates `cachedContext` on
successful identify, and uses that cached context when first starting
`LDClient`.
>
> The iOS native module wraps `afterIdentify` in `@try/@catch` (matching
other methods) and the example app’s `Podfile.lock` is updated to
`SessionReplayReactNative` `0.5.0` (and CocoaPods `1.16.2`).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2d22972. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 96c4516 commit b6ec2b1
3 files changed
Lines changed: 67 additions & 14 deletions
File tree
- sdk/@launchdarkly/react-native-ld-session-replay
- example/ios
- ios
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2512 | 2512 | | |
2513 | 2513 | | |
2514 | 2514 | | |
2515 | | - | |
| 2515 | + | |
2516 | 2516 | | |
2517 | 2517 | | |
2518 | 2518 | | |
| |||
2882 | 2882 | | |
2883 | 2883 | | |
2884 | 2884 | | |
2885 | | - | |
| 2885 | + | |
2886 | 2886 | | |
2887 | 2887 | | |
2888 | 2888 | | |
2889 | 2889 | | |
2890 | 2890 | | |
2891 | 2891 | | |
2892 | | - | |
| 2892 | + | |
Lines changed: 57 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
64 | 82 | | |
65 | 83 | | |
| 84 | + | |
66 | 85 | | |
67 | 86 | | |
68 | 87 | | |
| |||
78 | 97 | | |
79 | 98 | | |
80 | 99 | | |
81 | | - | |
| 100 | + | |
82 | 101 | | |
83 | 102 | | |
84 | 103 | | |
| |||
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
99 | 146 | | |
100 | 147 | | |
101 | 148 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
0 commit comments