getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.57k stars 337 forks source link

Session Replay - react-native-webview maskAllText #4126

Open ph8nt0m opened 4 weeks ago

ph8nt0m commented 4 weeks ago

OS:

Platform:

SDK:

SDK version: ^5.31.1

react-native version: 0.74.5

Are you using Expo?

Are you using sentry.io or on-premise?

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

ReactNativeSentry.init({ dsn: 'https://e96105128d654a5681e011b4be3e29cd@o4504245640232960.ingest.sentry.io/4504245656420352', _experiments: { replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 1.0, profilesSampleRate: 1.0, },

  environment: envs.envName,
  release: envs.version,

  debug: false,
  maxBreadcrumbs: 150,

  enableAutoSessionTracking: true,
  sessionTrackingIntervalMillis: 10000,

  integrations: [
    Sentry.mobileReplayIntegration({
      maskAllText: true,
      maskAllImages: true,
    }),
    new Sentry.ReactNativeTracing({
      idleTimeout: 5000,
      routingInstrumentation: reactNavigationInstrumentation,
      tracingOrigins: ['localhost', /^\//, /^https:\/\//],
    }),
  ],
  tracesSampleRate: 1.0,
}),


---
If I use react-native-webview, Text and images within the web view are not hidden.

Text and images outside the web view are easily obscured.
krystofwoldrich commented 3 weeks ago

Hi @ph8nt0m, thank you for the message,

this seems like a bug, the WebViews in RN Replays should be completely redacted by default.

As we are not able to read the web elements from the native Android and iOS layers where the RN replays is recorded we decided to completely redact WebViews.

krystofwoldrich commented 3 weeks ago

As a park of reproducing the issue let's add https://github.com/react-native-webview/react-native-webview to our sample app.