Skip to content

Session Replay: Add PreviewView to default masked view classes#5097

Merged
romtsn merged 5 commits intogetsentry:mainfrom
szijpeter:fix/4400-add-preview-view-to-default-masked-view-classes
Feb 13, 2026
Merged

Session Replay: Add PreviewView to default masked view classes#5097
romtsn merged 5 commits intogetsentry:mainfrom
szijpeter:fix/4400-add-preview-view-to-default-masked-view-classes

Conversation

@szijpeter
Copy link
Contributor

@szijpeter szijpeter commented Feb 12, 2026

📜 Description

PreviewView is the view used to display the camera feed for CameraX's Preview use case. Adding it to Replay option defaults aligns with existing sensitive defaults (TextView, ImageView, WebView, VideoView, player views) in SentryReplayOptions.

It's a low-risk, sensible default imo.

💡 Motivation and Context

💚 How did you test it?

Reproduction path:

  1. Use PreviewView in COMPATIBLE mode
  2. Keep screenshot strategy on the default path (PixelCopy), i.e. do not set Canvas.

👉🏼 https://github.com/szijpeter/sentry-java/tree/repro/4400

Why these two matter:

  • COMPATIBLE forces the TextureView path where camera pixels are composited into the normal view hierarchy and can show up in captures.
  • PERFORMANCE typically uses SurfaceView, which often gives black/non-captured camera content and can hide the bug (false negative). note that it might still fall back to TextureView in certain cases.
  • setting screenshot strategy to canvas is a different capture mode and masks broadly; it does not rely on the defaults
Repro Repro + Fix
repro repro+fix

Workarounds for older SDK versions

  • explicitly mask PreviewView in app code via addMaskViewClass
  • and/or set screenshot strategy to canvas

📝 Checklist

  • I added GH Issue ID & Linear ID
  • 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

adding screenshot tests? could be worth it, but I feel like maybe out of scope for this PR

@szijpeter szijpeter force-pushed the fix/4400-add-preview-view-to-default-masked-view-classes branch from fcdd4cb to 7f0346e Compare February 12, 2026 22:41
@szijpeter szijpeter marked this pull request as ready for review February 12, 2026 22:58
@szijpeter szijpeter changed the title Add PreviewView to default masked view classes Session Replay: Add PreviewView to default masked view classes Feb 13, 2026
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.

@szijpeter amazing investigation and detailed report, thanks a bunch! approving right away and going to merge right after 👍

@romtsn romtsn enabled auto-merge (squash) February 13, 2026 09:11
auto-merge was automatically disabled February 13, 2026 09:36

Head branch was pushed to by a user without write access

@romtsn romtsn enabled auto-merge (squash) February 13, 2026 09:59
@szijpeter
Copy link
Contributor Author

szijpeter commented Feb 13, 2026

@szijpeter amazing investigation and detailed report, thanks a bunch! approving right away and going to merge right after 👍

thanks @romtsn, happy to help :)

there was a small mistake, I've accidentally removed an empty line from the api file which made the apiCheck task fail.
should be fixed now (3b1668f)

@romtsn romtsn merged commit 066f0ab into getsentry:main Feb 13, 2026
59 of 61 checks passed
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.

Session Replay is unable to mask content when using the Camera

2 participants