Skip to content

Add masking debug overlay #4357

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

Merged
merged 13 commits into from
May 19, 2025

Conversation

markushi
Copy link
Member

@markushi markushi commented Apr 25, 2025

📜 Description

Masks, revealed
For debugging purposes

Screen_recording_20250516_111258.mp4

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@markushi markushi requested a review from romtsn April 25, 2025 08:11
Copy link
Contributor

github-actions bot commented Apr 25, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 414.02 ms 435.39 ms 21.37 ms
Size 1.58 MiB 2.08 MiB 510.83 KiB

Previous results on branch: markushi/feat/session-replay-masking-debug-mode

Startup times

Revision Plain With Sentry Diff
a1ad9eb 410.17 ms 447.29 ms 37.12 ms
3334b5a 415.90 ms 436.16 ms 20.26 ms
a08f05e 436.23 ms 466.02 ms 29.79 ms
6e73020 425.81 ms 493.12 ms 67.31 ms

App size

Revision Plain With Sentry Diff
a1ad9eb 1.58 MiB 2.08 MiB 510.65 KiB
3334b5a 1.58 MiB 2.08 MiB 510.82 KiB
a08f05e 1.58 MiB 2.08 MiB 510.82 KiB
6e73020 1.58 MiB 2.08 MiB 507.64 KiB

@romtsn
Copy link
Member

romtsn commented Apr 25, 2025

Do we want to expose this via options?
How can we ensure the flag to turn it on isn't accidentally committed

Yeah so I talked to @krystofwoldrich yesterday, and turns out iOS also has a similar option - we were thinking of introducing a top-level api like Sentry.toggleMaskingDebugOverlay() so it can be used with some kind of a debug/floating button and easily controlled at runtime instead of an init option. Wdyt?

@krystofwoldrich
Copy link
Member

Cocoa has SentrySDK.replay.showMaskPreview(0.5), the number is opacity of the overlay.

Related cocoa PRs:

@romtsn
Copy link
Member

romtsn commented Apr 25, 2025

Cocoa has SentrySDK.replay.showMaskPreview(0.5), the number is opacity of the overlay.

Related cocoa PRs:

alright, couldn't we draw stroke rectangles instead of solid? then we wouldn't need the opacity parameter. Just trying to align I guess

@markushi markushi marked this pull request as ready for review May 16, 2025 09:14
Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

great job!

@markushi markushi enabled auto-merge (squash) May 19, 2025 09:50
@markushi markushi merged commit 21f2cfa into main May 19, 2025
32 of 34 checks passed
@markushi markushi deleted the markushi/feat/session-replay-masking-debug-mode branch May 19, 2025 10:04
rbro112 pushed a commit that referenced this pull request May 20, 2025
* Add masking debug overlay

* Improve contrast for debug mode

* Improve readability

* Add ReplayIntegration.enableDebugMasking API, improve debug overlay

* Update Changelog

* Introduce IReplayApi

* Update Changelog

* Fix Sample app

* Move replay API from SentryAndroid to Sentry
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.

3 participants