Skip to content

Fix Session Replay masking during view transitions #4864

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

Open
4 tasks
kahest opened this issue Feb 18, 2025 · 2 comments
Open
4 tasks

Fix Session Replay masking during view transitions #4864

kahest opened this issue Feb 18, 2025 · 2 comments

Comments

@kahest
Copy link
Member

kahest commented Feb 18, 2025

Written by @philprime:

Current state of investigation:

Based on given replays visible in Sentry product I could pinpoint the partial frames without masking to screenshots taken during transitions, e.g. during a push-navigation of a detail view controller.

By enabling the "Slow Animations" in the debug menu of the iPhone simulator, and increasing the frame-rate of Session Replay from 1 FPS to 10 FPS, I am able to reliably reproduce the issue.

The currently released SDK does not allow configuration of the FPS, and while analyzing the issue at hand, I also had to fix the SDK to support higher frame-rates due to calculation and timing errors. I'll create a separate PR for that.

My current assumption is that during the transitions the view hierarchy is replaced by a snapshot view, which uses the same visual representation, but does not use an actual view hierarchy we can use to calculate redaction areas. Please see the discussion of UIView.snapshotView(afterScreenUpdates:) for details on snapshot views. This assumption is not yet proven, but the current main lead.

I pushed all the work-in-progress changes to philprime/sr-masking-analysis and for easier viewing opened up #5073

Next steps:

  • Analyze if unmasked view is a snapshot view + how to mask it (maybe fully mask during transition)
  • Disable screenshots taken during transitions (Potential Lead: https://stackoverflow.com/a/5526556/3515302)
  • Analyze potential inverse approach in masking to convert from the opt-out to an opt-in approach (i.e. instead of masking areas of the clear screenshot which are sensitive, cut out areas that are safe to show)
  • Create separate PR with fixes for higher frame rates
@kahest kahest converted this from a draft issue Feb 18, 2025
@kahest kahest moved this from Needs Discussion to Needs Investigation in [DEPRECATED] Mobile SDKs Feb 18, 2025
@philprime philprime self-assigned this Feb 26, 2025
@kahest kahest moved this from Needs Investigation to In Investigation in [DEPRECATED] Mobile SDKs Mar 26, 2025
@kahest
Copy link
Member Author

kahest commented Mar 26, 2025

related: #5023

@philprime
Copy link
Contributor

@kahest I updated the description of this issue with the details of the current state.

@kahest kahest added the Platform: Cocoa label Apr 14, 2025 — with Linear
@philprime philprime changed the title [SR] Masking improvements Fix Session Replay masking during view transitions Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Investigation
Development

No branches or pull requests

3 participants