getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

feat(replay): Add Mask/Unmask Containers for custom masking in hybrid SDKs #3881

Closed krystofwoldrich closed 4 days ago

krystofwoldrich commented 1 week ago

:scroll: Description

This PR adds masking containers for hybrid SDKs like RN.

RN implements ReactViewGroup Mask and Unmask on Android. These classes can be used from JS to custom mask elements.

This PR exposes options to set the implemented containers and used them for custom masking.

:green_heart: How did you test it?

rn sample app, integration tests

:pencil: Checklist

github-actions[bot] commented 1 week ago
Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 84596dc43c7cb741aa1e9778694a68d103f4e97a

github-actions[bot] commented 1 week ago

Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 396.54 ms 487.06 ms 90.52 ms
Size 1.70 MiB 2.35 MiB 669.36 KiB

Previous results on branch: kw/replay/add-mask-containers-for-hybrids

Startup times

Revision Plain With Sentry Diff
95d3a46cc62a7b086cd371715700cf778aab373a 403.06 ms 421.08 ms 18.02 ms
4db467c3820b91c49e3f1e0eb1a2aa2cfa3160a8 450.15 ms 464.73 ms 14.59 ms

App size

Revision Plain With Sentry Diff
95d3a46cc62a7b086cd371715700cf778aab373a 1.70 MiB 2.35 MiB 668.48 KiB
4db467c3820b91c49e3f1e0eb1a2aa2cfa3160a8 1.70 MiB 2.35 MiB 668.47 KiB
romtsn commented 1 week ago

btw, I'd also love to have a changelog entry for this, in case this causes problems we can always see it in the version history - this has bitten me in the past already a few times

krystofwoldrich commented 4 days ago

@romtsn Thank you for the review and updates.