sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Session replay not masking all text

Open Joannawork25 opened this issue 5 months ago • 8 comments

What React Native libraries do you use?

Hermes

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.17.0

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇ 

System:
  OS: macOS 15.5
  CPU: (8) arm64 Apple M1
  Memory: 185.03 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.3.0
    path: ~/.nvm/versions/node/v24.3.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.4.2
    path: ~/.nvm/versions/node/v24.3.0/bin/npm
  Watchman:
    version: 2025.06.30.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/limyiying/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.25410.109.2511.13665796
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /Users/limyiying/Documents/jdk17.0.12/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/limyiying/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false


Sentry.init()

Sentry.init({
  dsn: 'https://[email protected]/...'
 enableNdk:true,
    environment: env,
    enableNative: true, 
    enableNativeCrashHandling: true,
    attachScreenshot: true,});
 beforeBreadcrumb(breadcrumb, hint) {
      if (
        breadcrumb.category === 'console' ||
        breadcrumb.category === 'xhr' ||
        breadcrumb.category === 'fetch' && breadcrumb?.data?.url.includes(apiBasePath)
      ) {
        return null;
      }
      return breadcrumb;
    },
    attachViewHierarchy: true, 
    enableCaptureFailedRequests: false,
    sessionTrackingIntervalMillis: 60000, 
    integrations: [
      Sentry.mobileReplayIntegration({}),
      Sentry.httpClientIntegration(),
    ],
    tracesSampleRate: 1.0,
    replaysSessionSampleRate: 1.0,
    replaysOnErrorSampleRate: 1.0,
  })

Steps to Reproduce

Render long text in react native

    <Text key={'key1'} testID={'testID'} numberOfLines={2}>
      {     '12334332332321233433233232123343323323212334332332321233433233232123343323323212334332332321233433233232'
      }
    </Text>

Expected Result

Masked all text

Actual Result

Image

Joannawork25 avatar Jul 22 '25 09:07 Joannawork25

Thank you for opening this issue! Are you experiencing this on Android, iOS or both?

lucas-zimerman avatar Jul 22 '25 10:07 lucas-zimerman

Thank you for opening this issue! Are you experiencing this on Android, iOS or both?

currently experienced in android . ios not yet try.

Joannawork25 avatar Jul 22 '25 10:07 Joannawork25

Ran into this on IOS

justynpollard1 avatar Jul 28 '25 23:07 justynpollard1

@justynpollard1 could you post more details (e.g. an example screenshot, reproducible code snippet)? Android and iOS record differently, so this should be a different root cause than the original issue

romtsn avatar Jul 30 '25 09:07 romtsn

I am able to repro (on Android) the reported behaviour where

A RN <Text> component will sometimes fail to mask the character right before the line wraps, in a long line of text.

Image Image

The code used to repro is published here

@romtsn @kahest @bruno-garcia how concerned are about this masking behaviour? I wonder whether it has been observed on other platforms, maybe not react-native specific?

43jay avatar Sep 04 '25 22:09 43jay

update: this is expected to be addressed by a larger piece of work around masking on android currently wip. Goign to leave this issue as is until we can confirm fixed when that lands.

43jay avatar Sep 11 '25 16:09 43jay

Noting that https://github.com/getsentry/sentry-react-native/pull/5301 should fix the reported case after 7.5.0. Leaving this open till the new experimental Canvas Capture Strategy becomes the default.

antonis avatar Nov 18 '25 12:11 antonis