feat(react-native): add maskTestIDs and unmaskTestIDs masking options#528
Merged
Conversation
f3d2270 to
edd5f08
Compare
beekld
added a commit
that referenced
this pull request
May 5, 2026
…eplay masking (#527) ## Summary Two related fixes to the Android session replay SDK to make masking work correctly with React Native views: 1. `maskXMLViewIds` and `unmaskXMLViewIds` now also match the value of the `react_test_id` tag (RN's `testID` prop) when the React Native library is on the runtime classpath. Resolved reflectively so the SDK has no compile-time RN dependency. 3. `maskImageViews` now catches ImageView subclasses (notably RN's `ReactImageView`) instead of only the exact `android.widget.ImageView` class. ## How did you test this change? Tested with PR #528 using the example app and capturing a session replay. ## Are there any deployment considerations? N/A <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Updates session replay masking matchers, which can change what UI is captured vs masked (privacy-sensitive) and could cause over/under-masking in apps, especially with mixed native/RN view hierarchies. > > **Overview** > Improves `PrivacyProfile` masking to work with React Native-rendered views by having `maskXMLViewIds`/`unmaskXMLViewIds` also match RN’s `testID` via the `react_test_id` view tag (resolved reflectively to avoid an RN dependency). > > Updates `maskImageViews` to mask *all* `ImageView` instances (including subclasses) by introducing an `imageViewMatcher` instead of relying on exact-class matching, and refreshes docs/tests to reflect the new behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 65f2af5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
edd5f08 to
752772e
Compare
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.
Reviewed by Cursor Bugbot for commit 4d16967. Configure here.
abelonogov-ld
approved these changes
May 6, 2026
Merged
Vadman97
pushed a commit
that referenced
this pull request
May 6, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>session-replay-react-native: 0.9.0</summary> ## [0.9.0](session-replay-react-native-0.8.0...session-replay-react-native-0.9.0) (2026-05-06) ### Features * **react-native:** add maskTestIDs and unmaskTestIDs masking options ([#528](#528)) ([3d33328](3d33328)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk release bookkeeping only: version/manifest bumps and a changelog entry, with no functional code changes in this diff. > > **Overview** > Updates the Release Please manifest and `@launchdarkly/session-replay-react-native` package version from `0.8.0` to `0.9.0`. > > Adds the `0.9.0` changelog entry noting new React Native masking options (`maskTestIDs`/`unmaskTestIDs`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3fa7b73. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
maskTestIDsandunmaskTestIDsto the React Native session replay options. RN'stestIDprop is the natural way to identify specific views from JS for masking config.maskAccessibilityIdentifiers/unmaskAccessibilityIdentifiers) and Android (maskXMLViewIds/unmaskXMLViewIds).maskLabelsfor React Native apps, by including itsUILabelalternatives.MaskingScreenin the example app for manual verification..envmobile-key setup (viareact-native-dotenv) to work as it was already documented.How did you test this change?
Tested using the example app and capturing a session replay. Everything works as expected in both Android and iOS
App
Session Replay
Are there any deployment considerations?
N/A
Note
Medium Risk
Changes session replay privacy/masking behavior and underlying native option mapping on both iOS and Android, which could affect what user data is captured or redacted if misconfigured. Also bumps the Android observability dependency, so behavior may shift with upstream SDK changes.
Overview
Adds
maskTestIDsandunmaskTestIDsto the React Native session replay options and wires them through the native bridges (Android maps toPrivacyProfile.maskXMLViewIds/unmaskXMLViewIds; iOS maps to accessibility identifier masking and combines new keys with the deprecated*AccessibilityIdentifierslists).Fixes iOS
maskLabelsfor React Native by including RN text view classes inmaskUIViewswhen enabled. Updates the example app to demonstrate/verify testID-based masking (newMaskingScreen, simple tab UI) and fixes.envkey injection viareact-native-dotenv. Also bumpslaunchdarkly-observability-androidfrom0.42.0to0.45.0.Reviewed by Cursor Bugbot for commit 486e5cb. Bugbot is set up for automated code reviews on this repo. Configure here.