Skip to content

Commit c21a31f

Browse files
authored
fix(session-replay): Cherry-pick session replay masking fixes from main (#6678)
* fix(session-replay): Update rendering method for fast view rendering (#6360) * fix(session-replay): Extend masking and focus masking on sensitive information (#6292) * test(session-replay): Add masking tests for common cases (#6567) * test(session-replay): Add masking tests for React Native views (#6568) * fix(session-replay): Fix conversion of frame rate to time interval (#6623) * test(session-replay): Add masking tests for edge cases (#6569) * test(session-replay): Add masking tests for UIKit views (#6570) * test(session-replay): Add masking tests for special views (#6571) * fix(session-replay): Include layer background color when checking if a view is opaque (#6629) * chore(tests): Remove snapshot testing to reduce repository size (#6631) * chore: Remove unwanted CHANGELOG entries from cherry-pick - Remove #5591 (minimum OS version warnings) - not related to session replay - Remove #6019 (SCNetworkReachability) - not related to session replay - Remove #6377 (thread event issue) - not related to session replay - Remove #6381 (frame delay) - duplicate/not related to session replay - Keep only session replay masking related changes * docs: Move changelog changes from v8.57.1 to unreleased * test: Resolve wrong assertions involed due to merge-conflict * chore: Update sdk_api_V9.json
1 parent 653de7c commit c21a31f

24 files changed

+4667
-1135
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,9 @@ current_package_diff.patch
109109

110110
uikit-check-build
111111
*.xcarchive
112+
113+
# Output of `make analyze`
114+
analyzer
115+
116+
# Output of snapshot testing
117+
**/__Snapshots__

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Fix rendering method for fast view rendering (#6360)
8+
- Session Replay masking improvements (#6292)
9+
- Fix SwiftUI.List background decoration view causing incorrect clipping of screen content
10+
- Fix sublayer rendering order by properly sorting by zPosition with insertion order as tie-breaker
11+
- Fix UISwitch internal images being incorrectly redacted
12+
- Fix UITextField placeholder text (UITextFieldLabel) not being detected for redaction
13+
- Use string-based class comparison to avoid triggering Objective-C +initialize on background threads
14+
- Add layer class filtering for views used in multiple contexts (e.g., SwiftUI._UIGraphicsView)
15+
- Improve transform calculations for views with custom anchor points
16+
- Fix axis-aligned transform detection for optimized opaque view clipping
17+
- Fix conversion of frame rate to time interval for session replay (#6623)
18+
- Change Session Replay masking to prevent semi‑transparent full‑screen overlays from clearing redactions by making opaque clipping stricter (#6629)
19+
Views now need to be fully opaque (view and layer backgrounds with alpha == 1) and report opaque to qualify for clip‑out.
20+
This avoids leaks at the cost of fewer clip‑out optimizations.
21+
322
## 8.57.1
423

524
### Fixes

Sentry.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@
804804
D43B26D82D70A550007747FD /* SentryTraceOrigin.m in Sources */ = {isa = PBXBuildFile; fileRef = D43B26D72D70A54A007747FD /* SentryTraceOrigin.m */; };
805805
D43B26DA2D70A612007747FD /* SentrySpanDataKey.m in Sources */ = {isa = PBXBuildFile; fileRef = D43B26D92D70A60E007747FD /* SentrySpanDataKey.m */; };
806806
D4411DD52E02B74900EA4987 /* ArrayAccessesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4411DD42E02B74100EA4987 /* ArrayAccessesTests.swift */; };
807+
D44311312EB22812006CABE4 /* SentryUIRedactBuilderTests+ReactNative.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AF7D212E93FFCA004F0F59 /* SentryUIRedactBuilderTests+ReactNative.swift */; };
807808
D44B16722DE464AD006DBDB3 /* TestDispatchFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D44B16712DE464A9006DBDB3 /* TestDispatchFactoryTests.swift */; };
808809
D451ED5D2D92ECD200C9BEA8 /* SentryOnDemandReplayError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D451ED5C2D92ECD200C9BEA8 /* SentryOnDemandReplayError.swift */; };
809810
D451ED5F2D92ECDE00C9BEA8 /* SentryReplayFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = D451ED5E2D92ECDE00C9BEA8 /* SentryReplayFrame.swift */; };
@@ -849,6 +850,8 @@
849850
D4AF00212D2E92FD00F5F3D7 /* SentryNSFileManagerSwizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = D4AF00202D2E92FD00F5F3D7 /* SentryNSFileManagerSwizzling.m */; };
850851
D4AF00232D2E931000F5F3D7 /* SentryNSFileManagerSwizzling.h in Headers */ = {isa = PBXBuildFile; fileRef = D4AF00222D2E931000F5F3D7 /* SentryNSFileManagerSwizzling.h */; };
851852
D4AF00252D2E93C400F5F3D7 /* SentryNSFileManagerSwizzlingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D4AF00242D2E93C400F5F3D7 /* SentryNSFileManagerSwizzlingTests.m */; };
853+
D4AF7D2A2E940493004F0F59 /* SentryUIRedactBuilderTests+Common.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AF7D292E940492004F0F59 /* SentryUIRedactBuilderTests+Common.swift */; };
854+
D4AF7D2C2E9404ED004F0F59 /* SentryUIRedactBuilderTests+EdgeCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AF7D2B2E9404ED004F0F59 /* SentryUIRedactBuilderTests+EdgeCases.swift */; };
852855
D4B0DC7F2DA9257A00DE61B6 /* SentryRenderVideoResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4B0DC7E2DA9257200DE61B6 /* SentryRenderVideoResult.swift */; };
853856
D4C5F59A2D4249E6002A9BF6 /* DataSentryTracingIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C5F5992D4249E0002A9BF6 /* DataSentryTracingIntegrationTests.swift */; };
854857
D4CA34832E378C9900E92A61 /* SentryArrayTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CA34822E378C9000E92A61 /* SentryArrayTests.swift */; };
@@ -2198,6 +2201,11 @@
21982201
D4AF00202D2E92FD00F5F3D7 /* SentryNSFileManagerSwizzling.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNSFileManagerSwizzling.m; sourceTree = "<group>"; };
21992202
D4AF00222D2E931000F5F3D7 /* SentryNSFileManagerSwizzling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryNSFileManagerSwizzling.h; path = include/SentryNSFileManagerSwizzling.h; sourceTree = "<group>"; };
22002203
D4AF00242D2E93C400F5F3D7 /* SentryNSFileManagerSwizzlingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryNSFileManagerSwizzlingTests.m; sourceTree = "<group>"; };
2204+
D4AF7D212E93FFCA004F0F59 /* SentryUIRedactBuilderTests+ReactNative.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryUIRedactBuilderTests+ReactNative.swift"; sourceTree = "<group>"; };
2205+
D4AF7D252E9401EB004F0F59 /* SentryUIRedactBuilderTests+UIKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryUIRedactBuilderTests+UIKit.swift"; sourceTree = "<group>"; };
2206+
D4AF7D272E9402AC004F0F59 /* SentryUIRedactBuilderTests+SpecialViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryUIRedactBuilderTests+SpecialViews.swift"; sourceTree = "<group>"; };
2207+
D4AF7D292E940492004F0F59 /* SentryUIRedactBuilderTests+Common.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryUIRedactBuilderTests+Common.swift"; sourceTree = "<group>"; };
2208+
D4AF7D2B2E9404ED004F0F59 /* SentryUIRedactBuilderTests+EdgeCases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SentryUIRedactBuilderTests+EdgeCases.swift"; sourceTree = "<group>"; };
22012209
D4B0DC7E2DA9257200DE61B6 /* SentryRenderVideoResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryRenderVideoResult.swift; sourceTree = "<group>"; };
22022210
D4BCA0C22DA93C25009E49AB /* SentrySessionReplayIntegration+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentrySessionReplayIntegration+Test.h"; sourceTree = "<group>"; };
22032211
D4C5F5992D4249E0002A9BF6 /* DataSentryTracingIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataSentryTracingIntegrationTests.swift; sourceTree = "<group>"; };
@@ -4243,8 +4251,13 @@
42434251
D4009EA02D77196F0007AF30 /* ViewCapture */ = {
42444252
isa = PBXGroup;
42454253
children = (
4254+
D4AF802E2E965188004F0F59 /* __Snapshots__ */,
42464255
D82915622C85EF0C00A6CDD4 /* SentryViewPhotographerTests.swift */,
42474256
D8F67AF22BE10F7600C9197B /* SentryUIRedactBuilderTests.swift */,
4257+
D4AF7D292E940492004F0F59 /* SentryUIRedactBuilderTests+Common.swift */,
4258+
D4AF7D2B2E9404ED004F0F59 /* SentryUIRedactBuilderTests+EdgeCases.swift */,
4259+
D4AF7D252E9401EB004F0F59 /* SentryUIRedactBuilderTests+UIKit.swift */,
4260+
D4AF7D212E93FFCA004F0F59 /* SentryUIRedactBuilderTests+ReactNative.swift */,
42484261
D45E2D762E003EBF0072A6B7 /* TestRedactOptions.swift */,
42494262
);
42504263
path = ViewCapture;
@@ -4361,6 +4374,13 @@
43614374
path = InfoPlist;
43624375
sourceTree = "<group>";
43634376
};
4377+
D4AF802E2E965188004F0F59 /* __Snapshots__ */ = {
4378+
isa = PBXGroup;
4379+
children = (
4380+
);
4381+
path = __Snapshots__;
4382+
sourceTree = "<group>";
4383+
};
43644384
D4CBA2522DE06D1600581618 /* SentryTestUtilsTests */ = {
43654385
isa = PBXGroup;
43664386
children = (
@@ -6072,6 +6092,7 @@
60726092
FAC62B652E15A4100003909D /* SentrySDKThreadTests.swift in Sources */,
60736093
D82915632C85EF0C00A6CDD4 /* SentryViewPhotographerTests.swift in Sources */,
60746094
D8DBE0CA2C0E093000FAB1FD /* SentryTouchTrackerTests.swift in Sources */,
6095+
D4AF7D2C2E9404ED004F0F59 /* SentryUIRedactBuilderTests+EdgeCases.swift in Sources */,
60756096
D8F67AF42BE10F9600C9197B /* SentryUIRedactBuilderTests.swift in Sources */,
60766097
92ECD7482E05B57C0063EC10 /* SentryLogAttributeTests.swift in Sources */,
60776098
63B819141EC352A7002FDF4C /* SentryInterfacesTests.m in Sources */,
@@ -6126,6 +6147,7 @@
61266147
7BC6EBF4255C044A0059822A /* SentryEventTests.swift in Sources */,
61276148
63FE721920DA66EC00CDBAE8 /* SentryCrashReportStore_Tests.m in Sources */,
61286149
7B6D98EB24C6E84F005502FA /* SentryCrashInstallationReporterTests.swift in Sources */,
6150+
D44311312EB22812006CABE4 /* SentryUIRedactBuilderTests+ReactNative.swift in Sources */,
61296151
7BA61EA625F21E660008CAA2 /* SentrySDKLogTests.swift in Sources */,
61306152
62CFD9A92C99741100834E1B /* SentryInvalidJSONStringTests.swift in Sources */,
61316153
7BB42EF124F3B7B700D7B39A /* SentrySession+Equality.m in Sources */,
@@ -6156,6 +6178,7 @@
61566178
62F4DDA12C04CB9700588890 /* SentryBaggageSerializationTests.swift in Sources */,
61576179
7BE912AF272166DD00E49E62 /* SentryNoOpSpanTests.swift in Sources */,
61586180
D4F2B5352D0C69D500649E42 /* SentryCrashCTests.swift in Sources */,
6181+
D4AF7D2A2E940493004F0F59 /* SentryUIRedactBuilderTests+Common.swift in Sources */,
61596182
7B56D73524616E5600B842DA /* SentryConcurrentRateLimitsDictionaryTests.swift in Sources */,
61606183
7B7D8730248648AD00D2ECFF /* SentryStacktraceBuilderTests.swift in Sources */,
61616184
FA21A2EF2E60E9CB00E7EADB /* EnvelopeComparison.swift in Sources */,
@@ -6269,6 +6292,7 @@
62696292
D80694C42B7CC9AE00B820E6 /* SentryReplayEventTests.swift in Sources */,
62706293
7B34721728086A9D0041F047 /* SentrySwizzleWrapperTests.swift in Sources */,
62716294
8EC4CF5025C3A0070093DEE9 /* SentrySpanContextTests.swift in Sources */,
6295+
D4AF7D282E9402AC004F0F59 /* SentryUIRedactBuilderTests+SpecialViews.swift in Sources */,
62726296
6281C5742D3E50DF009D0978 /* ArbitraryDataTests.swift in Sources */,
62736297
7BE0DC2F272ABAF6004FA8B7 /* SentryAutoBreadcrumbTrackingIntegrationTests.swift in Sources */,
62746298
7B869EBE249B964D004F4FDB /* SentryThreadEquality.swift in Sources */,

Sources/Swift/Core/Tools/ViewCapture/SentryRedactRegion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
import ObjectiveC.NSObjCRuntime
55
import UIKit
66

7-
final class SentryRedactRegion {
7+
struct SentryRedactRegion: Equatable {
88
let size: CGSize
99
let transform: CGAffineTransform
1010
let type: SentryRedactRegionType

Sources/Swift/Core/Tools/ViewCapture/SentryRedactRegionType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public enum SentryRedactRegionType: String, Codable {
1+
public enum SentryRedactRegionType: String, Codable, Equatable {
22
/// Redacts the region.
33
case redact = "redact"
44

0 commit comments

Comments
 (0)