Skip to content

RUM-18048: Fix Fabric text mapping in minified Android builds - #1369

Open
jonathanmos wants to merge 1 commit into
developfrom
jmoskovich/rum-18048/fix-mspanned
Open

RUM-18048: Fix Fabric text mapping in minified Android builds#1369
jonathanmos wants to merge 1 commit into
developfrom
jmoskovich/rum-18048/fix-mspanned

Conversation

@jonathanmos

Copy link
Copy Markdown
Member

What does this PR do?

Fixes Session Replay text handling in minified Android builds using React Native’s new architecture.

R8 can rename an internal React Native text field, causing Session Replay to fail when reading styled text and generate repeated telemetry warnings. This change uses React Native’s supported accessor instead.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@jonathanmos
jonathanmos marked this pull request as ready for review August 13, 2026 10:25
@jonathanmos
jonathanmos requested a review from a team as a code owner August 13, 2026 10:25
Copilot AI lite review requested due to automatic review settings August 13, 2026 10:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Session Replay styled-text extraction for React Native new architecture on Android when apps are minified (R8), by removing reliance on reflective access to a private React Native field and switching to a supported accessor.

Changes:

  • Replaces reflective lookup of React Native’s internal mSpanned field with ReactTextView.spanned for Fabric text color extraction.
  • Simplifies FabricTextViewUtils by removing logger-based warning telemetry tied to the old reflection path.
  • Updates unit tests to mock ReactTextView.spanned directly instead of stubbing the reflection helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/react-native-session-replay/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/utils/text/TextViewUtilsTest.kt Adjusts Fabric-specific test to provide ReactTextView.spanned and remove reflection stubbing.
packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/TextViewUtils.kt Updates the new-architecture factory path to construct FabricTextViewUtils without a logger.
packages/react-native-session-replay/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/FabricTextViewUtils.kt Switches styled-text span extraction to use ReactTextView.spanned and removes reflection + warning logging.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sbarrio
sbarrio requested a review from cdn34dd August 14, 2026 07:07
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