Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Replay - react-native-webview maskAllText #4126

Open
5 tasks
ph8nt0m opened this issue Sep 29, 2024 · 15 comments
Open
5 tasks

Session Replay - react-native-webview maskAllText #4126

ph8nt0m opened this issue Sep 29, 2024 · 15 comments

Comments

@ph8nt0m
Copy link

ph8nt0m commented Sep 29, 2024

OS:

  • Windows
  • [O] MacOS
  • Linux

Platform:

  • [O] iOS
  • [O] Android

SDK:

  • [O] @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: ^5.31.1

react-native version: 0.74.5

Are you using Expo?

  • [O] Yes (Bare Workflow)
  • No

Are you using sentry.io or on-premise?

  • [O] sentry.io (SaaS)
  • 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
Copy link
Member

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
Copy link
Member

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

@hjonasson
Copy link

hjonasson commented Nov 3, 2024

I see the same in my app but not always. @krystofwoldrich . Did this end up being a bug that has since been fixed. Do you have more insights into it. Would adding data-sentry-mask do anything to guard against this happening again?

@romtsn
Copy link
Member

romtsn commented Nov 5, 2024

@hjonasson we currently have no mechanism of masking elements within the webviews, what we do instead is we mask the entire webview for now. Did you encounter this issue running on iOS or Android?

@ph8nt0m
Copy link
Author

ph8nt0m commented Nov 5, 2024

@romtsn Both ...

How can I mask the entire webview?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 5, 2024
@romtsn
Copy link
Member

romtsn commented Nov 5, 2024

@ph8nt0m if you're using SDK version 5.34.0 at least, they should be masked by default for both ios and android

@ph8nt0m
Copy link
Author

ph8nt0m commented Nov 5, 2024

Thanks, I will check it.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 5, 2024
@krystofwoldrich
Copy link
Member

We have added a webview to our sample app in #4215

And both on iOS and Android the webviews are redacted.

Currently we do not offer option to disable the webview redaction in RN.


If your webviews are not redacted on the latest version of the SDK (both V5 or V6) please share with us an example of the JS code you use to create the webviews.

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Nov 6, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Nov 6, 2024
@hjonasson
Copy link

hjonasson commented Nov 6, 2024

@romtsn This was on Android. I can't see if it was all Androids if that matters but it looks to appear pretty consistently on Samsung phones. What is the best way to address it ASAP? I already filed a Zendesk ticket for it.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 6, 2024
@romtsn
Copy link
Member

romtsn commented Nov 6, 2024

@hjonasson please see #4126 (comment), it should already work in the latest versions of the RN sdk. If not please provide a reproducible sample.

@hjonasson
Copy link

Thanks @romtsn. It should work, I know. We assumed that when we put it into production. However, it doesn't work. It doesn't reproduce locally but I have many production logs where I can see the full webview from the client. We have turned it off and deleted the logs as we should not be storing them in the first place. I can give you device types this was working on to investigate further.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 6, 2024
@romtsn
Copy link
Member

romtsn commented Nov 6, 2024

@hjonasson can you post a link to your project in sentry?

@hjonasson
Copy link

Not here. We will take it through the higher-ups, they are reaching out to Sentry now. I will keep you updated.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 6, 2024
@romtsn
Copy link
Member

romtsn commented Nov 6, 2024

@hjonasson Alright, but please make sure to update to version 5.34.0 at least, that's where webview masking was introduced. Also, feel free to reach out to [email protected] directly if you feel it's better to discuss this p2p. Thanks!

@krystofwoldrich
Copy link
Member

Since the last message, we released new Session Replay updates and improvements in https://github.com/getsentry/sentry-react-native/releases/tag/6.3.0-beta.2

Please try the latest beta and report any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: Needs More Information
Development

No branches or pull requests

5 participants