-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(apple): Add docs for screenshot masking options #15658
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM with a few suggestions.
| You can also choose to mask or unmask a specific view instance by using the replay API (`SentrySDK.replay`) or view extensions like this: | ||
|
|
||
| ```swift | ||
| SentrySDK.replay.maskView(view: view) | ||
| SentrySDK.replay.unmaskView(view: label) | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: The docs already mention that you can use the SR APIs for this above, but maybe we should again mention it here. Also, we should clearly explain if you need to enable SR or not for these APIs to work.
Side note: We should really have extra APIs for screenshots at some point. I find that quite confusing. 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep this PR on hold and introduce an API in the SDK first
docs/platforms/apple/common/enriching-events/screenshots/index.mdx
Outdated
Show resolved
Hide resolved
Bundle ReportChanges will increase total bundle size by 107.29kB (0.3%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
Co-authored-by: Philipp Hofmann <[email protected]>
|
BLOCKED BY getsentry/sentry-cocoa#6953 |
docs/platforms/apple/common/enriching-events/screenshots/index.mdx
Outdated
Show resolved
Hide resolved
coolguyzone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding.
….mdx Co-authored-by: Alex Krawiec <[email protected]>
| ### Mask by View Class | ||
|
|
||
| You can choose which type of view you want to mask or unmask by using the `maskedViewClasses` or `unmaskedViewClasses` options. | ||
|
|
||
| By default, Sentry already masks text and image elements from UIKit. Every child of a view that is redacted will also be redacted. The `unmaskedViewClasses` property has precedence over `maskedViewClasses`, meaning if a view class appears in both lists, it will be unmasked. | ||
|
|
||
| Let's say you have a custom view that you want to mask and a `UILabel` subclass (which normally would be masked) that you don't want to mask. You can set the options like this: | ||
|
|
||
| ```swift | ||
| options.screenshot.maskedViewClasses = [MyCustomView.self] | ||
| options.screenshot.unmaskedViewClasses = [MyCustomLabel.self] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Documented options.screenshot.* may not exist in SDK, causing runtime errors.
Severity: MEDIUM | Confidence: Medium
🔍 Detailed Analysis
The documentation introduces options.screenshot.* configuration options, including maskAllText, maskAllImages, maskedViewClasses, unmaskedViewClasses, enableViewRendererV2, and enableFastViewRendering. These options are not corroborated elsewhere in the documentation repository, unlike their options.sessionReplay.* counterparts. If these options.screenshot.* properties do not exist in the Sentry Cocoa SDK, developers attempting to configure them will encounter runtime errors.
💡 Suggested Fix
Verify the existence and exact names of all options.screenshot.* configuration properties in the Sentry Cocoa SDK. Update the documentation to accurately reflect the SDK's implementation.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: docs/platforms/apple/common/enriching-events/screenshots/index.mdx#L50-L65
Potential issue: The documentation introduces `options.screenshot.*` configuration
options, including `maskAllText`, `maskAllImages`, `maskedViewClasses`,
`unmaskedViewClasses`, `enableViewRendererV2`, and `enableFastViewRendering`. These
options are not corroborated elsewhere in the documentation repository, unlike their
`options.sessionReplay.*` counterparts. If these `options.screenshot.*` properties do
not exist in the Sentry Cocoa SDK, developers attempting to configure them will
encounter runtime errors.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5756755
DESCRIBE YOUR PR
Adds documentation about configuring masking of screenshots. Based on the already existing session replay masking documentation. As the two options sets are different (
options.sessionReplay.*vsoptions.screenshot.*) we should duplicate the documentation for now in case of drift.We need to revisit this issue with getsentry/sentry-cocoa#6060
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: