feat: Expose screenshot masking options for error screenshots#6007
feat: Expose screenshot masking options for error screenshots#6007
Conversation
Add `screenshot.maskAllText` and `screenshot.maskAllImages` options to control masking of sensitive content in error screenshots on Android. These options bridge to the Android SDK's `SentryScreenshotOptions` API (available since sentry-android 8.34.0). Closes #5763 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
Document the new `screenshot.maskAllText` and `screenshot.maskAllImages` options for error screenshot masking on Android. Companion SDK PR: getsentry/sentry-react-native#6007 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5c3c299. Configure here.
Bridge screenshot masking options to iOS via the Cocoa SDK's SentryViewScreenshotOptions init(dictionary:) API. Both platforms (Android and iOS) now support screenshot.maskAllText and screenshot.maskAllImages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 566760f. Configure here.
…ions Support masking/unmasking specific native view classes in error screenshots. Useful for third-party native views like map SDKs, payment forms, or video players. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Screenshot masking depends on UIKit, not session replay. Use SENTRY_HAS_UIKIT to match the guard used by the Cocoa SDK for attachScreenshot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@sentry review |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a504753. Configure here.
📢 Type of change
📜 Description
Adds
screenshotoptions to control masking of sensitive content in error screenshots on both Android and iOS.Options:
maskAllText/maskAllImages— toggle automatic masking of text and images (default:true)maskedViewClasses/unmaskedViewClasses— mask or unmask specific native view classes (useful for third-party libraries like map SDKs, payment forms, video players)Platform support:
SentryScreenshotOptionsviaoptions.getScreenshot()(available sincesentry-android8.34.0, current: 8.38.0)SentryViewScreenshotOptionsviainit(dictionary:)(Cocoa SDK 9.10.0)💡 Motivation and Context
Both native SDKs support screenshot masking for error screenshots, but the React Native SDK only exposed
attachScreenshotas a boolean with no way to configure masking. This meant error screenshots could contain sensitive data (text, images) with no opt-out.Closes #5763
💚 How did you test it?
wrapper.test.tsverifyingscreenshotoptions pass through to the native moduleRNSentryStartTests.swiftfor screenshot masking options and defaultsyarn build)yarn test)📝 Checklist
sendDefaultPIIis enabled🔮 Next steps