Skip to content
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

ref: Changing the redact logic #4327

Merged
merged 55 commits into from
Sep 18, 2024
Merged

ref: Changing the redact logic #4327

merged 55 commits into from
Sep 18, 2024

Conversation

brustolin
Copy link
Contributor

@brustolin brustolin commented Sep 12, 2024

📜 Description

Before this PR, redactAllText was wrongly used as a "redact is enabled" flag.

Now we're using redactAllText and redactAllImages as an indicator to how start the redact list:

if options.redactAllText {
       redactClasses += [ UILabel.self, UITextView.self, UITextField.self ]
}
        
if options.redactAllImages {
    //this classes are used by SwiftUI to display images.
    redactClasses += ["_TtCOCV7SwiftUI11DisplayList11ViewUpdater8Platform13CGDrawingView",
             "_TtC7SwiftUIP33_A34643117F00277B93DEBAB70EC0697122_UIShapeHitTestingView",
             "SwiftUI._UIGraphicsView", "SwiftUI.ImageLayer"
    ].compactMap { NSClassFromString($0) }
            
    redactClasses.append(UIImageView.self)
}

An exception is UIWebView and WKWebView that are always added to redact view.

Also, we're making a change to the ignoreRedact behaviour, that will not be inherited by its subviews.

💚 How did you test it?

Unit tests

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • 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.
  • 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.

@brustolin brustolin marked this pull request as ready for review September 12, 2024 13:55
@brustolin brustolin marked this pull request as draft September 12, 2024 14:50
@brustolin brustolin marked this pull request as draft September 12, 2024 14:50
brustolin and others added 2 commits September 13, 2024 08:58
A label that is outside of bounds of a view with clipBounds true is no longer being redacted.
Base automatically changed from fix/out-of-clip-redact to fix/redact-under-translucent September 13, 2024 13:56
@brustolin brustolin marked this pull request as ready for review September 16, 2024 12:40
CHANGELOG.md Outdated Show resolved Hide resolved
Base automatically changed from fix/redact-under-translucent to main September 16, 2024 16:07
@getsentry getsentry deleted a comment from github-actions bot Sep 17, 2024
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, with a few suggestions 👍

Sources/Swift/Tools/UIRedactBuilder.swift Outdated Show resolved Hide resolved
Sources/Swift/Tools/UIRedactBuilder.swift Show resolved Hide resolved
Sources/Swift/Tools/UIRedactBuilder.swift Show resolved Hide resolved
Sources/Swift/Tools/UIRedactBuilder.swift Show resolved Hide resolved
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
@brustolin brustolin merged commit c2dd146 into main Sep 18, 2024
65 checks passed
@brustolin brustolin deleted the fix/redact-logic branch September 18, 2024 06:57
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