From 549e1d7e8ebfbb8cc3ab957e89c31fb83fb29686 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 12:37:29 +0100 Subject: [PATCH 1/7] internal(hybrid): Add Replay Mask options to dict init --- Brewfile.lock.json | 26 +-- .../SessionReplay/SentryReplayOptions.swift | 6 + .../SentryReplayOptionsTests.swift | 152 +++++++++++++++++- 3 files changed, 170 insertions(+), 14 deletions(-) diff --git a/Brewfile.lock.json b/Brewfile.lock.json index ca8b73ac01..85f08cf1f4 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -2,40 +2,40 @@ "entries": { "brew": { "clang-format": { - "version": "19.1.1", + "version": "19.1.3", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sequoia": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:7b5f8c066c04e831f51f2abf16312084e3fa098b0ff76abc6480967a2860bd24", - "sha256": "7b5f8c066c04e831f51f2abf16312084e3fa098b0ff76abc6480967a2860bd24" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9df6e7a73647777ea7d721611ff214cb6dfb0035270f7c075706c10126127fe7", + "sha256": "9df6e7a73647777ea7d721611ff214cb6dfb0035270f7c075706c10126127fe7" }, "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:e7ba64f5fba3cf0ceadaa3c520a2208642ce1169bffac8db1e9b56569195148e", - "sha256": "e7ba64f5fba3cf0ceadaa3c520a2208642ce1169bffac8db1e9b56569195148e" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:51c70ed59125cdc84a9e69c71519e0389302fa79ec69237daad87d56f880fef7", + "sha256": "51c70ed59125cdc84a9e69c71519e0389302fa79ec69237daad87d56f880fef7" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:ce317db950e3d268110f2bc62c5f1aa07cbb50dafd2603e168e363718a9d9e21", - "sha256": "ce317db950e3d268110f2bc62c5f1aa07cbb50dafd2603e168e363718a9d9e21" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:221b6502def9c8349e7b55503a925b7afad79e75edeaad2039d449156e31fe00", + "sha256": "221b6502def9c8349e7b55503a925b7afad79e75edeaad2039d449156e31fe00" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:43bcbde28012da49f5679bec7ba8d2c341771cee9909bddde1ec2e29e1fd8320", - "sha256": "43bcbde28012da49f5679bec7ba8d2c341771cee9909bddde1ec2e29e1fd8320" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:387d602bb80b80d5e46d091bb620080d5734022b0512b42be0a0368416e40ff5", + "sha256": "387d602bb80b80d5e46d091bb620080d5734022b0512b42be0a0368416e40ff5" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:80ac7aac07528efb14db1928d1268db16033dcbaf73a0fa5c1d08817d3bf3ab4", - "sha256": "80ac7aac07528efb14db1928d1268db16033dcbaf73a0fa5c1d08817d3bf3ab4" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:8609c73a51e4a27538fec7cf473da6a8808a273291c04df0f15959c134104048", + "sha256": "8609c73a51e4a27538fec7cf473da6a8808a273291c04df0f15959c134104048" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:f8318eea6c50bf91462397af31ee5c20413dfb1a6625aa8b73d524f4b7396180", - "sha256": "f8318eea6c50bf91462397af31ee5c20413dfb1a6625aa8b73d524f4b7396180" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:b1f7cdba80030cd264f64d22fc3d5e0865c7167a0b2462a64bfe82d155e821c2", + "sha256": "b1f7cdba80030cd264f64d22fc3d5e0865c7167a0b2462a64bfe82d155e821c2" } } } diff --git a/Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift b/Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift index a29b3a050b..5b7352a2b3 100644 --- a/Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift +++ b/Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift @@ -152,5 +152,11 @@ public class SentryReplayOptions: NSObject, SentryRedactOptions { let maskAllText = (dictionary["maskAllText"] as? NSNumber)?.boolValue ?? true let maskAllImages = (dictionary["maskAllImages"] as? NSNumber)?.boolValue ?? true self.init(sessionSampleRate: sessionSampleRate, onErrorSampleRate: onErrorSampleRate, maskAllText: maskAllText, maskAllImages: maskAllImages) + self.maskedViewClasses = ((dictionary["maskedViewClasses"] as? NSArray) ?? []).compactMap({ element in + NSClassFromString((element as? String) ?? "") + }) + self.unmaskedViewClasses = ((dictionary["unmaskedViewClasses"] as? NSArray) ?? []).compactMap({ element in + NSClassFromString((element as? String) ?? "") + }) } } diff --git a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift index 98575ddecd..127d18b248 100644 --- a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift +++ b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift @@ -27,5 +27,155 @@ class SentryReplayOptionsTests: XCTestCase { XCTAssertEqual(options.replayBitRate, 60_000) XCTAssertEqual(options.sizeScale, 1.0) } - + + func testInitFromDictOnErrorSampleRateAsDouble() { + let options = SentryReplayOptions(dictionary: [ + "errorSampleRate": 0.44 + ]) + + XCTAssertEqual(options.onErrorSampleRate, 0.44) + } + + func testInitFromDictOnErrorSampleRateMissing() { + let options = SentryReplayOptions(dictionary: [:]) + + XCTAssertEqual(options.onErrorSampleRate, 0) + } + + func testInitFromDictOnErrorSampleRateAsString() { + let options = SentryReplayOptions(dictionary: [ + "onErrorSampleRate": "0.44" + ]) + + XCTAssertEqual(options.onErrorSampleRate, 0) + } + + func testInitFromDictSessionSampleRateAsDouble() { + let options = SentryReplayOptions(dictionary: [ + "sessionSampleRate": 0.44 + ]) + + XCTAssertEqual(options.sessionSampleRate, 0.44) + } + + func testInitFromDictSessionSampleRateMissing() { + let options = SentryReplayOptions(dictionary: [:]) + + XCTAssertEqual(options.sessionSampleRate, 0) + } + + func testInitFromDictSessionSampleRateAsString() { + let options = SentryReplayOptions(dictionary: [ + "sessionSampleRate": "0.44" + ]) + + XCTAssertEqual(options.sessionSampleRate, 0) + } + + func testInitFromDictMaskedViewClasses() { + let options = SentryReplayOptions(dictionary: [ + "maskedViewClasses": ["UILabel"] + ]) + + XCTAssertEqual(options.maskedViewClasses.count, 1) + XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses[0]), ObjectIdentifier(UILabel.self)) + } + + func testInitFromDictMaskedViewClassesAsString() { + let options = SentryReplayOptions(dictionary: [ + "maskedViewClasses": "UILabel" + ]) + + XCTAssertEqual(options.maskedViewClasses.count, 0) + } + + func testInitFromDictMaskedViewClassesWithNumber() { + let options = SentryReplayOptions(dictionary: [ + "maskedViewClasses": [123] + ]) + + XCTAssertEqual(options.maskedViewClasses.count, 0) + } + + func testInitFromDictUnmaskedViewClasses() { + let options = SentryReplayOptions(dictionary: [ + "unmaskedViewClasses": ["UILabel"] + ]) + + XCTAssertEqual(options.unmaskedViewClasses.count, 1) + XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first as AnyClass), ObjectIdentifier(UILabel.self)) + } + + func testInitFromDictUnmaskedViewClassesAsString() { + let options = SentryReplayOptions(dictionary: [ + "unmaskedViewClasses": "invalid_value" + ]) + + XCTAssertEqual(options.unmaskedViewClasses.count, 0) + } + + func testInitFromDictUnmaskedViewClassesWithInvalidValues() { + let options = SentryReplayOptions(dictionary: [ + "unmaskedViewClasses": [123, "not.class"] + ]) + + XCTAssertEqual(options.unmaskedViewClasses.count, 0) + } + + func testInitFromDictMaskAllTextWithBool() { + let options = SentryReplayOptions(dictionary: [ + "maskAllText": true + ]) + XCTAssertTrue(options.maskAllText) + + let options2 = SentryReplayOptions(dictionary: [ + "maskAllText": false + ]) + XCTAssertFalse(options2.maskAllText) + } + + func testInitFromDictMaskAllTextWithString() { + let options = SentryReplayOptions(dictionary: [ + "maskAllText": "invalid_value" + ]) + XCTAssertTrue(options.maskAllText) + } + + func testInitFromDictMaskAllImagesWithBool() { + let options = SentryReplayOptions(dictionary: [ + "maskAllImages": true + ]) + XCTAssertTrue(options.maskAllImages) + + let options2 = SentryReplayOptions(dictionary: [ + "maskAllImages": false + ]) + XCTAssertFalse(options2.maskAllImages) + } + + func testInitFromDictMaskAllImagesWithString() { + let options = SentryReplayOptions(dictionary: [ + "maskAllImages": "invalid_value" + ]) + XCTAssertTrue(options.maskAllImages) + } + + func testInitFromDictWithMultipleOptions() { + let options = SentryReplayOptions(dictionary: [ + "sessionSampleRate": 0.5, + "errorSampleRate": 0.8, + "maskAllText": false, + "maskedViewClasses": ["UIView", "not.a.class", 123], + "unmaskedViewClasses": ["UILabel", "invalid", true] + ]) + + XCTAssertEqual(options.sessionSampleRate, 0.5) + XCTAssertEqual(options.onErrorSampleRate, 0.8) + XCTAssertFalse(options.maskAllText) + XCTAssertTrue(options.maskAllImages) + XCTAssertEqual(options.maskedViewClasses.count, 1) + XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first), ObjectIdentifier(UIView.self)) + XCTAssertEqual(options.unmaskedViewClasses.count, 1) + XCTAssertEqual(options.unmaskedViewClasses.first, UILabel.self) + } } From 4595cdddf08bfebdc2676a13f6cce9327765bdef Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 12:43:42 +0100 Subject: [PATCH 2/7] add changelog --- CHANGELOG.md | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1cffb2d9e..aa0de50f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Improve frames tracker performance (#4469) - Log a warning when dropping envelopes due to rate-limiting (#4463) - Expose `SentrySessionReplayIntegration-Hybrid.h` as `private` (#4486) +- Add `maskedViewClasses` and `unmaskedViewClasses` to SentryReplayOptions init via dict (#4492) ## 8.39.0 @@ -391,7 +392,7 @@ to receive SIGTERM events, set the option `enableSigtermReporting = true`. ### Features -The following two features, disabled by default, were mistakenly added to the release. We usually only add features in minor releases. +The following two features, disabled by default, were mistakenly added to the release. We usually only add features in minor releases. - Add option to use own NSURLSession for transport (#3811) - Support sending GraphQL operation names in HTTP breadcrumbs (#3931) @@ -412,9 +413,9 @@ The following two features, disabled by default, were mistakenly added to the re - Remove not needed lock for logging (#3934) - Session replay Improvements (#3877) - - Use image average color and text font color to redact session replay + - Use image average color and text font color to redact session replay - Removed iOS 16 restriction from session replay - - Performance improvement + - Performance improvement ## 8.25.0 @@ -426,7 +427,7 @@ The following two features, disabled by default, were mistakenly added to the re ### Fixes - Crash due to a background call to -[UIApplication applicationState] (#3855) -- Save framework without UIKit/AppKit as Github Asset for releases (#3858) +- Save framework without UIKit/AppKit as Github Asset for releases (#3858) - Fix crash associated with runtime collision in global C function names (#3862) - Remove wrong error log in SentryCoreDataTracker (#3894) - Don't transmit device boot time in envelopes enriched with crash data (#3912, #3916) @@ -445,7 +446,7 @@ The following two features, disabled by default, were mistakenly added to the re ### Fixes - Crash due to a background call to -[UIApplication applicationState] (#3855) -- Save framework without UIKit/AppKit as Github Asset for releases (#3858) +- Save framework without UIKit/AppKit as Github Asset for releases (#3858) - Fix crash associated with runtime collision in global C function names (#3862) - Remove wrong error log in SentryCoreDataTracker (#3894) @@ -504,7 +505,7 @@ more about how to use the Metrics API. ## 8.22.1 -### Fixes +### Fixes - Checksum error when resolving the SDK via SPM (#3760) @@ -581,7 +582,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de - Add visionOS as device family (#3548) - Add VisionOS Support for Carthage (#3565) -### Fixes +### Fixes - Move header reference out of "extern C" (#3538) - Clarify FramesTracker log message (#3570) @@ -630,7 +631,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de ## 8.17.1 -### Fixes +### Fixes - Crash when UINavigationController doesn't have rootViewController (#3455) - Crash when synchronizing invalid JSON breadcrumbs to SentryWatchdogTermination (#3458) @@ -642,7 +643,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de ### Features -- SwiftUI support is no longer in Beta (#3441) +- SwiftUI support is no longer in Beta (#3441) ## 8.16.1 @@ -802,7 +803,7 @@ and [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrick ## 8.9.4 ### Fixes - + - Remove linker settings from Package.swift (#3188) - Free memory returned by backtrace_symbols() in debug builds ([#3202](https://github.com/getsentry/sentry-cocoa/pull/3202)) @@ -929,7 +930,7 @@ For the Swift error above Sentry displays: [Customized error descriptions](https://docs.sentry.io/platforms/apple/usage/#customizing-error-descriptions) have precedence over this feature. This change has no impact on grouping of the issues in Sentry. -### Fixes +### Fixes - Propagate span when copying scope (#2952) - Remove "/" from crash report file name (#3005) @@ -944,7 +945,7 @@ This change has no impact on grouping of the issues in Sentry. - Create User and Breadcrumb from map (#2820) -### Fixes +### Fixes - Improved performance serializing profiling data (#2863) - Possible crash in Core Data tracking (#2865) @@ -978,9 +979,9 @@ The `stitchAsyncCode` experimental option has been removed from `SentryOptions` - Add `name` and `geo` to User (#2710) ### Fixes - + - Correctly track and send GPU frame render data in profiles (#2823) -- Xcode 14.3 compiling issue regarding functions declaration with no prototype (#2852) +- Xcode 14.3 compiling issue regarding functions declaration with no prototype (#2852) ## 8.3.3 @@ -1006,7 +1007,7 @@ The `stitchAsyncCode` experimental option has been removed from `SentryOptions` ## 8.3.1 -### Fixes +### Fixes - Stop using UIScreen.main (#2762) - Profile timestamp alignment with transactions (#2771) and app start spans (#2772) @@ -1072,7 +1073,7 @@ This change might mark 3rd party library frames as in-app, which the SDK previou ### Features -This version adds a dependency on Swift. +This version adds a dependency on Swift. We renamed the default branch from `master` to `main`. We are going to keep the `master` branch for backwards compatibility for package managers pointing to the `master` branch. ### Features @@ -1088,7 +1089,7 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Enable CaptureFailedRequests by default (#2507) - Support the [`SENTRY_DSN` environment variable](https://docs.sentry.io/platforms/apple/guides/macos/configuration/options/#dsn) on macOS (#2534) - Experimental MetricKit integration (#2519) for - - [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic) + - [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic) - [MXDiskWriteExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxdiskwriteexceptiondiagnostic) - [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxcpuexceptiondiagnostic) - Add a timeout for auto-generated transactions (#2535) @@ -1115,7 +1116,7 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Make `SpanProtocol.data` non nullable (#2409) - Mark `- [SpanProtocol setExtraValue:forKey:]` as deprecated (#2413) - Make SpanContext immutable (#2408) - - Remove tags from SpanContext + - Remove tags from SpanContext - Remove context property from SentrySpan - Bump minimum supported OS versions to macOS 10.13, iOS 11, tvOS 11, and watchOS 4 (#2414) - Make public APIs Swift friendly @@ -1128,8 +1129,8 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Remove `SentryScope.apply(to:maxBreadcrumb:)` (#2416) - Remove `- [SentryOptions initWithDict:didFailWithError:]` (#2404) - Remove `- [SentryOptions sdkInfo]` (#2404) - - Make SentrySession and SentrySDKInfo internal (#2451) -- Marks App hang's event stacktrace snapshot as true (#2441) + - Make SentrySession and SentrySDKInfo internal (#2451) +- Marks App hang's event stacktrace snapshot as true (#2441) - Enable user interaction tracing by default (#2442) - Remove default attachment content type (#2443) - Rename APM tracking feature flags to tracing (#2450) From 0c3e7edf3d085f714335967bf6c40cd010757703 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 12:57:45 +0100 Subject: [PATCH 3/7] fix tests --- .../SessionReplay/SentryReplayOptionsTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift index 127d18b248..5b6e123fbe 100644 --- a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift +++ b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift @@ -103,7 +103,7 @@ class SentryReplayOptionsTests: XCTestCase { ]) XCTAssertEqual(options.unmaskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first as AnyClass), ObjectIdentifier(UILabel.self)) + XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(UILabel.self)) } func testInitFromDictUnmaskedViewClassesAsString() { @@ -174,8 +174,8 @@ class SentryReplayOptionsTests: XCTestCase { XCTAssertFalse(options.maskAllText) XCTAssertTrue(options.maskAllImages) XCTAssertEqual(options.maskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first), ObjectIdentifier(UIView.self)) + XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first!), ObjectIdentifier(UIView.self)) XCTAssertEqual(options.unmaskedViewClasses.count, 1) - XCTAssertEqual(options.unmaskedViewClasses.first, UILabel.self) + XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(UILabel.self)) } } From 8737aeaaa243bffe635b4e40edcab053780f1bb3 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 13:15:53 +0100 Subject: [PATCH 4/7] fix tests for mac and type [any] --- .../SentryReplayOptionsTests.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift index 5b6e123fbe..0af07610af 100644 --- a/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift +++ b/Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift @@ -74,16 +74,16 @@ class SentryReplayOptionsTests: XCTestCase { func testInitFromDictMaskedViewClasses() { let options = SentryReplayOptions(dictionary: [ - "maskedViewClasses": ["UILabel"] + "maskedViewClasses": ["NSString"] ]) XCTAssertEqual(options.maskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses[0]), ObjectIdentifier(UILabel.self)) + XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first!), ObjectIdentifier(NSString.self)) } func testInitFromDictMaskedViewClassesAsString() { let options = SentryReplayOptions(dictionary: [ - "maskedViewClasses": "UILabel" + "maskedViewClasses": "ExampleView1" ]) XCTAssertEqual(options.maskedViewClasses.count, 0) @@ -99,11 +99,11 @@ class SentryReplayOptionsTests: XCTestCase { func testInitFromDictUnmaskedViewClasses() { let options = SentryReplayOptions(dictionary: [ - "unmaskedViewClasses": ["UILabel"] + "unmaskedViewClasses": ["NSString"] ]) XCTAssertEqual(options.unmaskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(UILabel.self)) + XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(NSString.self)) } func testInitFromDictUnmaskedViewClassesAsString() { @@ -116,7 +116,7 @@ class SentryReplayOptionsTests: XCTestCase { func testInitFromDictUnmaskedViewClassesWithInvalidValues() { let options = SentryReplayOptions(dictionary: [ - "unmaskedViewClasses": [123, "not.class"] + "unmaskedViewClasses": [123, "not.class"] as [Any] ]) XCTAssertEqual(options.unmaskedViewClasses.count, 0) @@ -165,8 +165,8 @@ class SentryReplayOptionsTests: XCTestCase { "sessionSampleRate": 0.5, "errorSampleRate": 0.8, "maskAllText": false, - "maskedViewClasses": ["UIView", "not.a.class", 123], - "unmaskedViewClasses": ["UILabel", "invalid", true] + "maskedViewClasses": ["NSString", "not.a.class", 123] as [Any], + "unmaskedViewClasses": ["NSNumber", "invalid", true] as [Any] ]) XCTAssertEqual(options.sessionSampleRate, 0.5) @@ -174,8 +174,8 @@ class SentryReplayOptionsTests: XCTestCase { XCTAssertFalse(options.maskAllText) XCTAssertTrue(options.maskAllImages) XCTAssertEqual(options.maskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first!), ObjectIdentifier(UIView.self)) + XCTAssertEqual(ObjectIdentifier(options.maskedViewClasses.first!), ObjectIdentifier(NSString.self)) XCTAssertEqual(options.unmaskedViewClasses.count, 1) - XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(UILabel.self)) + XCTAssertEqual(ObjectIdentifier(options.unmaskedViewClasses.first!), ObjectIdentifier(NSNumber.self)) } } From 1e85d283c0250fa244053a0aadcf8fdd94cbabd2 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 13:28:46 +0100 Subject: [PATCH 5/7] Revert "add changelog" This reverts commit 4595cdddf08bfebdc2676a13f6cce9327765bdef. --- CHANGELOG.md | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa0de50f17..e1cffb2d9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ - Improve frames tracker performance (#4469) - Log a warning when dropping envelopes due to rate-limiting (#4463) - Expose `SentrySessionReplayIntegration-Hybrid.h` as `private` (#4486) -- Add `maskedViewClasses` and `unmaskedViewClasses` to SentryReplayOptions init via dict (#4492) ## 8.39.0 @@ -392,7 +391,7 @@ to receive SIGTERM events, set the option `enableSigtermReporting = true`. ### Features -The following two features, disabled by default, were mistakenly added to the release. We usually only add features in minor releases. +The following two features, disabled by default, were mistakenly added to the release. We usually only add features in minor releases. - Add option to use own NSURLSession for transport (#3811) - Support sending GraphQL operation names in HTTP breadcrumbs (#3931) @@ -413,9 +412,9 @@ The following two features, disabled by default, were mistakenly added to the re - Remove not needed lock for logging (#3934) - Session replay Improvements (#3877) - - Use image average color and text font color to redact session replay + - Use image average color and text font color to redact session replay - Removed iOS 16 restriction from session replay - - Performance improvement + - Performance improvement ## 8.25.0 @@ -427,7 +426,7 @@ The following two features, disabled by default, were mistakenly added to the re ### Fixes - Crash due to a background call to -[UIApplication applicationState] (#3855) -- Save framework without UIKit/AppKit as Github Asset for releases (#3858) +- Save framework without UIKit/AppKit as Github Asset for releases (#3858) - Fix crash associated with runtime collision in global C function names (#3862) - Remove wrong error log in SentryCoreDataTracker (#3894) - Don't transmit device boot time in envelopes enriched with crash data (#3912, #3916) @@ -446,7 +445,7 @@ The following two features, disabled by default, were mistakenly added to the re ### Fixes - Crash due to a background call to -[UIApplication applicationState] (#3855) -- Save framework without UIKit/AppKit as Github Asset for releases (#3858) +- Save framework without UIKit/AppKit as Github Asset for releases (#3858) - Fix crash associated with runtime collision in global C function names (#3862) - Remove wrong error log in SentryCoreDataTracker (#3894) @@ -505,7 +504,7 @@ more about how to use the Metrics API. ## 8.22.1 -### Fixes +### Fixes - Checksum error when resolving the SDK via SPM (#3760) @@ -582,7 +581,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de - Add visionOS as device family (#3548) - Add VisionOS Support for Carthage (#3565) -### Fixes +### Fixes - Move header reference out of "extern C" (#3538) - Clarify FramesTracker log message (#3570) @@ -631,7 +630,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de ## 8.17.1 -### Fixes +### Fixes - Crash when UINavigationController doesn't have rootViewController (#3455) - Crash when synchronizing invalid JSON breadcrumbs to SentryWatchdogTermination (#3458) @@ -643,7 +642,7 @@ information retrieved via `NSFileSystemFreeSize` and `NSFileSystemSize` off a de ### Features -- SwiftUI support is no longer in Beta (#3441) +- SwiftUI support is no longer in Beta (#3441) ## 8.16.1 @@ -803,7 +802,7 @@ and [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrick ## 8.9.4 ### Fixes - + - Remove linker settings from Package.swift (#3188) - Free memory returned by backtrace_symbols() in debug builds ([#3202](https://github.com/getsentry/sentry-cocoa/pull/3202)) @@ -930,7 +929,7 @@ For the Swift error above Sentry displays: [Customized error descriptions](https://docs.sentry.io/platforms/apple/usage/#customizing-error-descriptions) have precedence over this feature. This change has no impact on grouping of the issues in Sentry. -### Fixes +### Fixes - Propagate span when copying scope (#2952) - Remove "/" from crash report file name (#3005) @@ -945,7 +944,7 @@ This change has no impact on grouping of the issues in Sentry. - Create User and Breadcrumb from map (#2820) -### Fixes +### Fixes - Improved performance serializing profiling data (#2863) - Possible crash in Core Data tracking (#2865) @@ -979,9 +978,9 @@ The `stitchAsyncCode` experimental option has been removed from `SentryOptions` - Add `name` and `geo` to User (#2710) ### Fixes - + - Correctly track and send GPU frame render data in profiles (#2823) -- Xcode 14.3 compiling issue regarding functions declaration with no prototype (#2852) +- Xcode 14.3 compiling issue regarding functions declaration with no prototype (#2852) ## 8.3.3 @@ -1007,7 +1006,7 @@ The `stitchAsyncCode` experimental option has been removed from `SentryOptions` ## 8.3.1 -### Fixes +### Fixes - Stop using UIScreen.main (#2762) - Profile timestamp alignment with transactions (#2771) and app start spans (#2772) @@ -1073,7 +1072,7 @@ This change might mark 3rd party library frames as in-app, which the SDK previou ### Features -This version adds a dependency on Swift. +This version adds a dependency on Swift. We renamed the default branch from `master` to `main`. We are going to keep the `master` branch for backwards compatibility for package managers pointing to the `master` branch. ### Features @@ -1089,7 +1088,7 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Enable CaptureFailedRequests by default (#2507) - Support the [`SENTRY_DSN` environment variable](https://docs.sentry.io/platforms/apple/guides/macos/configuration/options/#dsn) on macOS (#2534) - Experimental MetricKit integration (#2519) for - - [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic) + - [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic) - [MXDiskWriteExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxdiskwriteexceptiondiagnostic) - [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxcpuexceptiondiagnostic) - Add a timeout for auto-generated transactions (#2535) @@ -1116,7 +1115,7 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Make `SpanProtocol.data` non nullable (#2409) - Mark `- [SpanProtocol setExtraValue:forKey:]` as deprecated (#2413) - Make SpanContext immutable (#2408) - - Remove tags from SpanContext + - Remove tags from SpanContext - Remove context property from SentrySpan - Bump minimum supported OS versions to macOS 10.13, iOS 11, tvOS 11, and watchOS 4 (#2414) - Make public APIs Swift friendly @@ -1129,8 +1128,8 @@ We renamed the default branch from `master` to `main`. We are going to keep the - Remove `SentryScope.apply(to:maxBreadcrumb:)` (#2416) - Remove `- [SentryOptions initWithDict:didFailWithError:]` (#2404) - Remove `- [SentryOptions sdkInfo]` (#2404) - - Make SentrySession and SentrySDKInfo internal (#2451) -- Marks App hang's event stacktrace snapshot as true (#2441) + - Make SentrySession and SentrySDKInfo internal (#2451) +- Marks App hang's event stacktrace snapshot as true (#2441) - Enable user interaction tracing by default (#2442) - Remove default attachment content type (#2443) - Rename APM tracking feature flags to tracing (#2450) From df57993f84f96a9ccb09d53d16ed984862d75ed8 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 13:29:31 +0100 Subject: [PATCH 6/7] fix only add changelog new text --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1cffb2d9e..5d3afb0b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Improve frames tracker performance (#4469) - Log a warning when dropping envelopes due to rate-limiting (#4463) - Expose `SentrySessionReplayIntegration-Hybrid.h` as `private` (#4486) +- Add `maskedViewClasses` and `unmaskedViewClasses` to SentryReplayOptions init via dict (#4492) ## 8.39.0 From 9c7aaa760c83e6f0ae65ecae6bdca450ee2bf496 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 31 Oct 2024 13:32:39 +0100 Subject: [PATCH 7/7] revert brew lock --- Brewfile.lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Brewfile.lock.json b/Brewfile.lock.json index 85f08cf1f4..ca8b73ac01 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -2,40 +2,40 @@ "entries": { "brew": { "clang-format": { - "version": "19.1.3", + "version": "19.1.1", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sequoia": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9df6e7a73647777ea7d721611ff214cb6dfb0035270f7c075706c10126127fe7", - "sha256": "9df6e7a73647777ea7d721611ff214cb6dfb0035270f7c075706c10126127fe7" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:7b5f8c066c04e831f51f2abf16312084e3fa098b0ff76abc6480967a2860bd24", + "sha256": "7b5f8c066c04e831f51f2abf16312084e3fa098b0ff76abc6480967a2860bd24" }, "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:51c70ed59125cdc84a9e69c71519e0389302fa79ec69237daad87d56f880fef7", - "sha256": "51c70ed59125cdc84a9e69c71519e0389302fa79ec69237daad87d56f880fef7" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:e7ba64f5fba3cf0ceadaa3c520a2208642ce1169bffac8db1e9b56569195148e", + "sha256": "e7ba64f5fba3cf0ceadaa3c520a2208642ce1169bffac8db1e9b56569195148e" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:221b6502def9c8349e7b55503a925b7afad79e75edeaad2039d449156e31fe00", - "sha256": "221b6502def9c8349e7b55503a925b7afad79e75edeaad2039d449156e31fe00" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:ce317db950e3d268110f2bc62c5f1aa07cbb50dafd2603e168e363718a9d9e21", + "sha256": "ce317db950e3d268110f2bc62c5f1aa07cbb50dafd2603e168e363718a9d9e21" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:387d602bb80b80d5e46d091bb620080d5734022b0512b42be0a0368416e40ff5", - "sha256": "387d602bb80b80d5e46d091bb620080d5734022b0512b42be0a0368416e40ff5" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:43bcbde28012da49f5679bec7ba8d2c341771cee9909bddde1ec2e29e1fd8320", + "sha256": "43bcbde28012da49f5679bec7ba8d2c341771cee9909bddde1ec2e29e1fd8320" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:8609c73a51e4a27538fec7cf473da6a8808a273291c04df0f15959c134104048", - "sha256": "8609c73a51e4a27538fec7cf473da6a8808a273291c04df0f15959c134104048" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:80ac7aac07528efb14db1928d1268db16033dcbaf73a0fa5c1d08817d3bf3ab4", + "sha256": "80ac7aac07528efb14db1928d1268db16033dcbaf73a0fa5c1d08817d3bf3ab4" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:b1f7cdba80030cd264f64d22fc3d5e0865c7167a0b2462a64bfe82d155e821c2", - "sha256": "b1f7cdba80030cd264f64d22fc3d5e0865c7167a0b2462a64bfe82d155e821c2" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:f8318eea6c50bf91462397af31ee5c20413dfb1a6625aa8b73d524f4b7396180", + "sha256": "f8318eea6c50bf91462397af31ee5c20413dfb1a6625aa8b73d524f4b7396180" } } }