Skip to content

fix(android): Mask prepared text layout views in replay and screenshots - #7011

Merged
antonis merged 5 commits into
mainfrom
fix/android-prepared-text-masking
Nov 11, 2026
Merged

antonis merged 5 commits into
mainfrom
fix/android-prepared-text-masking

Conversation

@antonis

@antonis antonis commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds com.facebook.react.views.text.PreparedLayoutTextView to the masked view classes on Android whenever maskAllText is on, for both Session Replay and error screenshots.

  • Screenshots: the class is masked when maskAllText is on.
  • Replay: the class is added before the early returns in getReplayOptions, so it is also covered when sample rates are set without mobileReplayIntegration. In that case JS sends no mobileReplayOptions and the native default still masks text.
  • maskAllText: false: the class is explicitly unmasked in replay, mirroring how sentry-java handles TextView. Classes in the user's maskedViewClasses / unmaskedViewClasses are applied afterwards and take precedence.

These views use the generic mask path, so the mask is one black block over the whole <Text> instead of per-line rectangles in the text color.

💡 Motivation and Context

Fixes #7010

RN 0.89 changes the default of enablePreparedTextLayout to true, so a regular <Text> renders as PreparedLayoutTextView. That class extends ViewGroup and draws the layout itself. maskAllText matches android.widget.TextView, so with the default pixelCopy strategy this text would be left visible.

The class and flag already exist in 0.88 with the flag off by default, so apps that opted in there are covered too. The change is a string match, so it has no effect on RN versions that don't use this view. iOS keeps RCTParagraphComponentView, which is already redacted.

💚 How did you test it?

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

antonis and others added 2 commits November 10, 2026 12:53
React Native 0.89 renders <Text> with PreparedLayoutTextView by default.
It extends ViewGroup, so the android.widget.TextView match behind
maskAllText does not cover it.

Fixes #7010

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antonis antonis self-assigned this Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(android): Mask prepared text layout views in replay and screenshots by antonis and claude in #7011
  • fix(ios): Register replay mask classes when sample rates are 0 by alwx in #7008
  • feat(ios): Forward experimental enableWatchdogTerminationsV2 to sentry-cocoa by alwx in #7012
  • docs: Update Warden skills mentioned in the review skill by antonis and claude in #7004
  • ci: Skip CI for warden.toml-only changes by antonis and claude in #7005
  • build(deps): Bump joi to 17.13.9 to resolve ReDoS advisory by antonis and claude in #7003
  • chore(deps): bump getsentry/craft from 3.9.0 to 3.11.1 by dependabot in #7001
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 3.9.0 to 3.11.1 by dependabot in #6999
  • chore(deps): bump actions/setup-java from 6.1.0 to 6.2.0 by dependabot in #7002
  • chore(deps): bump ruby/setup-ruby from 1.336.0 to 1.338.0 by dependabot in #7000
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6998
  • chore(warden): Remove find-bugs, already covered by code-review by dcramer with sentry-junior in #6997
  • chore(deps): update Sentry Android Gradle Plugin to v6.26.0 by github-actions in #6995
  • chore(warden): Enable incremental review by Jeffreyhung with sentry-junior in #6994
  • chore(deps): update Android SDK to v8.63.0 by github-actions in #6990

🤖 This preview updates automatically when you update the PR.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2bd4350. Configure here.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Nov 10, 2026
@antonis
antonis marked this pull request as ready for review November 10, 2026 12:11
@antonis
antonis requested review from a team and lucas-zimerman as code owners November 10, 2026 12:11
@antonis
antonis requested review from alwx and buenaflor and removed request for a team November 10, 2026 12:11
@sentry

sentry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.34.0 (114) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis antonis removed the ready-to-merge Triggers the full CI test suite label Nov 10, 2026
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Nov 11, 2026

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@antonis
antonis merged commit 322ad1b into main Nov 11, 2026
84 checks passed
@antonis
antonis deleted the fix/android-prepared-text-masking branch November 11, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: maskAllText misses PreparedLayoutTextView, default text layout in RN 0.89

2 participants