fix(session-replay): Ignore list background decoration view in redaction #6292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 Description
Ignores the decoration view used in SwiftUI from the redaction algorithm.
💡 Motivation and Context
One screen of the dogfooding app Flinky had the following masking issue in a screen where a Grid and a List are inside a VStack, where the entire top half was unmasked:
Further analysis using
(lldb) po view.value(forKey: "recursiveDescription")!
surfaced that theSwiftUI.List
is implemented as aSwiftUI.UpdateCoalescingCollectionView
, a subclass ofUICollectionView
, which uses a_UICollectionViewListLayoutSectionBackgroundColorDecorationView
to display its background color.This background view massively overextends the list bounds with it's frame of
(-20 -1135.33; 442 2336)
and causes calculation issues in the clipping.The easiest solution for now was simply ignoring the view from the redaction algorithm.
💚 How did you test it?
I used the Flinky project with a locally checked out Sentry Cocoa SDK repo and directly compiled it. After running the app I checked the replay in Sentry.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.