Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2942089
fix(session-replay): Ignore list background decoration view in redaction
philprime Sep 26, 2025
648f62d
Merge remote-tracking branch 'origin/main' into philprime/fix-masking
philprime Sep 29, 2025
26dccd1
add comments
philprime Sep 29, 2025
ea7ecaa
WIP
philprime Sep 30, 2025
edfe055
WIP
philprime Oct 2, 2025
3b84342
WIP
philprime Oct 3, 2025
b7e28ef
WIP
philprime Oct 3, 2025
0fc7b14
Merge remote-tracking branch 'origin/main' into philprime/fix-masking
philprime Oct 6, 2025
2adac27
WIP
philprime Oct 6, 2025
5777824
WIP
philprime Oct 6, 2025
fa8a6ed
add snapshot tests
philprime Oct 6, 2025
53cff29
Merge remote-tracking branch 'origin/main' into philprime/fix-masking
philprime Oct 7, 2025
e180ae3
update tests in common
philprime Oct 8, 2025
1595fb0
fix uiswitch masking
philprime Oct 8, 2025
d627f40
cleanup
philprime Oct 8, 2025
8bb64c2
add more assertions to SwiftUI redaction tests
philprime Oct 8, 2025
98c4cb8
Merge remote-tracking branch 'origin/main' into philprime/fix-masking
philprime Oct 8, 2025
f0d3b4d
remove legacy screenshot snapshots
philprime Oct 8, 2025
5d5eddb
fix linting issues
philprime Oct 8, 2025
1176dad
revert mask renderer scale 2
philprime Oct 8, 2025
c2cc920
regenerate snapshots at 1x
philprime Oct 8, 2025
7c1cd59
add snapshots for SwiftUI masking tests
philprime Oct 9, 2025
3ae9bd4
Merge remote-tracking branch 'origin/main' into philprime/fix-masking
philprime Oct 14, 2025
1ccb38a
WIP
philprime Oct 14, 2025
d0aa648
wip
philprime Oct 14, 2025
4e67405
WIP
philprime Oct 14, 2025
8e6ea50
fixes
philprime Oct 15, 2025
00a82e8
remove unstable SwiftUI tests
philprime Oct 15, 2025
081e33b
Revert "remove unstable SwiftUI tests"
philprime Oct 15, 2025
13423d1
revert skipping tests
philprime Oct 15, 2025
8b5086f
wip
philprime Oct 15, 2025
4188bfc
remove reference to removed file
philprime Oct 15, 2025
56aa82a
Merge branch 'philprime/fix-masking' into philprime/swiftui-masking-t…
philprime Oct 15, 2025
6f8c247
revert remove reference
philprime Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Fix rendering method for fast view rendering (#6360)
- Fix issue where the thread that generated an event could be missing when more than 100 threads are running (#6377)
- Fix wrong Frame Delay when becoming active, which lead to false reported app hangs when the app moves to the foreground after being in the background (#6381)
- Add SwiftUI.List's background decoration view to ignored redaction views (#6292)

### Improvements

Expand Down
63 changes: 59 additions & 4 deletions Sentry.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

473 changes: 329 additions & 144 deletions Sources/Swift/Core/Tools/ViewCapture/SentryUIRedactBuilder.swift

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ import UIKit
}

public func image(view: UIView, onComplete: @escaping ScreenshotCallback) {
// Define a helper variable for the size, so the view is not accessed in the async block
let viewSize = view.bounds.size

// The redact regions are expected to be thread-safe data structures
let redactRegions = redactBuilder.redactRegionsFor(view: view)

// The render method is synchronous and must be called on the main thread.
// This is because the render method accesses the view hierarchy which is managed from the main thread.
let renderedScreenshot = renderer.render(view: view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,28 +342,32 @@ class SentrySessionReplayIntegrationTests: XCTestCase {
}

func testMaskViewFromSDK() throws {
class AnotherLabel: UILabel {
}
// -- Arrange --
class AnotherLabel: UILabel {}

startSDK(sessionSampleRate: 1, errorSampleRate: 1) { options in
options.sessionReplay.maskedViewClasses = [AnotherLabel.self]
}

let sut = try getSut()
let redactBuilder = sut.viewPhotographer.getRedactBuilder()
XCTAssertTrue(redactBuilder.containsRedactClass(AnotherLabel.self))

// -- Act --
let redactBuilder = try getSut().viewPhotographer.getRedactBuilder()

// -- Assert --
XCTAssertTrue(redactBuilder.containsRedactClass(viewClass: AnotherLabel.self, layerClass: CALayer.self))
}

func testIgnoreViewFromSDK() throws {
class AnotherLabel: UILabel {
}
// -- Arrange --
class AnotherLabel: UILabel {}

startSDK(sessionSampleRate: 1, errorSampleRate: 1) { options in
options.sessionReplay.unmaskedViewClasses = [AnotherLabel.self]
}

let sut = try getSut()
let redactBuilder = sut.viewPhotographer.getRedactBuilder()

// -- Act --
let redactBuilder = try getSut().viewPhotographer.getRedactBuilder()

// -- Assert --
XCTAssertTrue(redactBuilder.containsIgnoreClass(AnotherLabel.self))
}

Expand Down
Loading
Loading