Skip to content

Commit 86eb6d5

Browse files
authored
chore: Remove some deprecated properties for v9 (#6616)
* chore: Remove some deprecated properties for v9 * Fix test build
1 parent 0280704 commit 86eb6d5

File tree

11 files changed

+1
-501
lines changed

11 files changed

+1
-501
lines changed

Sources/Sentry/Public/SentryDefines.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,6 @@ typedef NSNumber *_Nullable (^SentryTracesSamplerCallback)(
152152
typedef NS_ENUM(NSUInteger,
153153
SentryLevel); // This is a forward declaration, the actual enum is implemented in Swift.
154154

155-
/**
156-
* Static internal helper to convert enum to string.
157-
*/
158-
static DEPRECATED_MSG_ATTRIBUTE(
159-
"Use nameForSentryLevel() instead.") NSString *_Nonnull const SentryLevelNames[]
160-
= {
161-
@"none",
162-
@"debug",
163-
@"info",
164-
@"warning",
165-
@"error",
166-
@"fatal",
167-
};
168-
169155
static NSUInteger const defaultMaxBreadcrumbs = 100;
170156

171157
static NSString *_Nonnull const kSentryTrueString = @"true";

Sources/Sentry/Public/SentryScope.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ NS_SWIFT_NAME(Scope)
107107
*/
108108
- (void)addBreadcrumb:(SentryBreadcrumb *)crumb NS_SWIFT_NAME(addBreadcrumb(_:));
109109

110-
- (void)add:(SentryBreadcrumb *)crumb DEPRECATED_MSG_ATTRIBUTE("use `addBreadcrumb` instead")
111-
NS_SWIFT_NAME(add(_:));
112-
113110
/**
114111
* Clears all breadcrumbs in the scope
115112
*/
@@ -139,11 +136,6 @@ NS_SWIFT_NAME(Scope)
139136
*/
140137
- (void)addAttachment:(SentryAttachment *)attachment NS_SWIFT_NAME(addAttachment(_:));
141138

142-
// We want to keep the old Swift `add(_ attachment:)` function as deprecated, but we cant have
143-
// another objc `add` method
144-
- (void)includeAttachment:(SentryAttachment *)attachment
145-
DEPRECATED_MSG_ATTRIBUTE("use `addAttachment` instead")NS_SWIFT_NAME(add(_:));
146-
147139
/**
148140
* Clears all attachments in the scope.
149141
*/

Sources/Sentry/Public/SentrySpanStatus.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ typedef NS_ENUM(NSUInteger, SentrySpanStatus) {
9696
kSentrySpanStatusDataLoss,
9797
};
9898

99-
static DEPRECATED_MSG_ATTRIBUTE(
100-
"Use nameForSentrySpanStatus() instead.") NSString *_Nonnull const SentrySpanStatusNames[]
101-
= { @"undefined", @"ok", @"deadline_exceeded", @"unauthenticated", @"permission_denied",
102-
@"not_found", @"resource_exhausted", @"invalid_argument", @"unimplemented",
103-
@"unavailable", @"internal_error", @"unknown_error", @"cancelled", @"already_exists",
104-
@"failed_precondition", @"aborted", @"out_of_range", @"data_loss" };
105-
10699
NS_ASSUME_NONNULL_BEGIN
107100

108101
FOUNDATION_EXPORT NSString *const kSentrySpanStatusNameUndefined;

Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,6 @@ public final class SentryReplayOptions: NSObject, SentryRedactOptions {
162162
*/
163163
public var unmaskedViewClasses: [AnyClass]
164164

165-
/**
166-
* Alias for ``enableViewRendererV2``.
167-
*
168-
* This flag is deprecated and will be removed in a future version.
169-
* Please use ``enableViewRendererV2`` instead.
170-
*/
171-
@available(*, deprecated, renamed: "enableViewRendererV2")
172-
public var enableExperimentalViewRenderer: Bool {
173-
get {
174-
enableViewRendererV2
175-
}
176-
set {
177-
enableViewRendererV2 = newValue
178-
}
179-
}
180-
181165
/**
182166
* Enables the up to 5x faster new view renderer used by the Session Replay integration.
183167
*
@@ -316,8 +300,7 @@ public final class SentryReplayOptions: NSObject, SentryRedactOptions {
316300
onErrorSampleRate: (dictionary["errorSampleRate"] as? NSNumber)?.floatValue,
317301
maskAllText: (dictionary["maskAllText"] as? NSNumber)?.boolValue,
318302
maskAllImages: (dictionary["maskAllImages"] as? NSNumber)?.boolValue,
319-
enableViewRendererV2: (dictionary["enableViewRendererV2"] as? NSNumber)?.boolValue
320-
?? (dictionary["enableExperimentalViewRenderer"] as? NSNumber)?.boolValue,
303+
enableViewRendererV2: (dictionary["enableViewRendererV2"] as? NSNumber)?.boolValue,
321304
enableFastViewRendering: (dictionary["enableFastViewRendering"] as? NSNumber)?.boolValue,
322305
maskedViewClasses: (dictionary["maskedViewClasses"] as? NSArray)?.compactMap({ element in
323306
NSClassFromString((element as? String) ?? "")

Sources/Swift/Protocol/Codable/SentryUserCodable.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import Foundation
33

44
final class UserDecodable: User {
5-
@available(*, deprecated)
65
convenience public init(from decoder: any Decoder) throws {
76
try self.init(decodedFrom: decoder)
87
}

Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,6 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase {
5454
XCTAssertEqual(result, [])
5555
}
5656

57-
@available(*, deprecated, message: "The test is marked as deprecated to silence the deprecation warning of the tested property.")
58-
func testEnableExperimentalViewRenderer_isEnabled_shouldAddFeature() throws {
59-
#if os(iOS)
60-
// -- Arrange --
61-
let options = Options()
62-
63-
options.sessionReplay.enableExperimentalViewRenderer = true
64-
65-
// -- Act --
66-
let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options)
67-
68-
// -- Assert --
69-
XCTAssert(features.contains("experimentalViewRenderer"))
70-
#else
71-
throw XCTSkip("Test not supported on this platform")
72-
#endif
73-
}
74-
7557
func testEnableViewRendererV2_isEnabled_shouldAddFeature() throws {
7658
#if os(iOS)
7759
// -- Arrange --

Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ class SentryNetworkTrackerTests: XCTestCase {
960960
XCTAssertEqual(task.currentRequest?.allHTTPHeaderFields?["traceparent"] ?? "", "test")
961961
}
962962

963-
@available(*, deprecated)
964963
func testDefaultHeadersWhenDisabled() throws {
965964
let sut = fixture.getSut()
966965
sut.disable()
@@ -976,7 +975,6 @@ class SentryNetworkTrackerTests: XCTestCase {
976975
XCTAssertEqual(task.currentRequest?.allHTTPHeaderFields?["sentry-trace"] ?? "", expectedTraceHeader)
977976
}
978977

979-
@available(*, deprecated)
980978
func testDefaultHeadersWhenNoTransaction() {
981979
let sut = fixture.getSut()
982980
let task = createDataTask()

Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -564,75 +564,6 @@ class SentryReplayOptionsTests: XCTestCase {
564564
// -- Assert --
565565
XCTAssertTrue(options.enableViewRendererV2)
566566
}
567-
568-
func testInitFromDict_enableViewRendererV2_precedenceOverEnableExperimentalViewRenderer() {
569-
// -- Act --
570-
let options = SentryReplayOptions(dictionary: [
571-
"enableViewRendererV2": false,
572-
"enableExperimentalViewRenderer": true
573-
])
574-
575-
// -- Assert --
576-
XCTAssertFalse(options.enableViewRendererV2)
577-
}
578-
579-
func testInitFromDict_enableExperimentalViewRenderer_whenValidValue_shouldSetValue() {
580-
// To support backwards compatibility we keep support for the old key
581-
// "experimentalViewRenderer" until we remove it in a future version.
582-
583-
// -- Act --
584-
let options = SentryReplayOptions(dictionary: [
585-
"enableExperimentalViewRenderer": true
586-
])
587-
588-
// -- Assert --
589-
XCTAssertTrue(options.enableViewRendererV2)
590-
591-
let options2 = SentryReplayOptions(dictionary: [
592-
"enableExperimentalViewRenderer": false
593-
])
594-
595-
// -- Assert --
596-
XCTAssertTrue(options.enableViewRendererV2)
597-
XCTAssertFalse(options2.enableViewRendererV2)
598-
}
599-
600-
func testInitFromDict_enableExperimentalViewRenderer_whenInvalidValue_shouldUseDefaultValue() {
601-
// To support backwards compatibility we keep support for the old key
602-
// "experimentalViewRenderer" until we remove it in a future version.
603-
604-
// -- Act --
605-
let options = SentryReplayOptions(dictionary: [
606-
"enableExperimentalViewRenderer": "invalid_value"
607-
])
608-
609-
// -- Assert --
610-
XCTAssertTrue(options.enableViewRendererV2)
611-
}
612-
613-
func testInitFromDict_enableViewRendererV2WithBool_shouldIgnoreValue() {
614-
// -- Act --
615-
let options = SentryReplayOptions(dictionary: [
616-
"enableExperimentalViewRenderer": true
617-
])
618-
let options2 = SentryReplayOptions(dictionary: [
619-
"enableExperimentalViewRenderer": false
620-
])
621-
622-
// -- Assert --
623-
XCTAssertTrue(options.enableViewRendererV2)
624-
XCTAssertFalse(options2.enableViewRendererV2)
625-
}
626-
627-
func testInitFromDict_enableViewRendererV2WithString_shouldIgnoreValue() {
628-
// -- Act --
629-
let options = SentryReplayOptions(dictionary: [
630-
"enableExperimentalViewRenderer": "invalid_value"
631-
])
632-
633-
// -- Assert --
634-
XCTAssertTrue(options.enableViewRendererV2)
635-
}
636567

637568
func testInitFromDict_enableFastViewRendering_whenValidValue_shouldSetValue() {
638569
let options = SentryReplayOptions(dictionary: [
@@ -705,28 +636,6 @@ class SentryReplayOptionsTests: XCTestCase {
705636
XCTAssertEqual(options.quality, .low)
706637
}
707638

708-
@available(*, deprecated, message: "The test is marked as deprecated to silence the deprecation warning of the tested property.")
709-
func testExperimentalViewRenderer_shouldBeAnAliasForEnableViewRendererV2() {
710-
// -- Arrange --
711-
let options = SentryReplayOptions()
712-
options.enableViewRendererV2 = false
713-
options.enableExperimentalViewRenderer = false
714-
715-
// -- Act & Assert --
716-
XCTAssertFalse(options.enableViewRendererV2)
717-
XCTAssertFalse(options.enableExperimentalViewRenderer)
718-
719-
options.enableViewRendererV2 = true
720-
721-
XCTAssertTrue(options.enableViewRendererV2)
722-
XCTAssertTrue(options.enableExperimentalViewRenderer)
723-
724-
options.enableExperimentalViewRenderer = false
725-
726-
XCTAssertFalse(options.enableViewRendererV2)
727-
XCTAssertFalse(options.enableExperimentalViewRenderer)
728-
}
729-
730639
// MARK: frameRate
731640

732641
func testInitFromDict_frameRate_whenValidValue_shouldSetValue() {

Tests/SentryTests/Protocol/SentryUserTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@_spi(Private) @testable import Sentry
22
import XCTest
33

4-
@available(*, deprecated)
54
class SentryUserTests: XCTestCase {
65

76
func testInitWithDictionary() {

Tests/SentryTests/SentryScopeSwiftTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class SentryScopeSwiftTests: XCTestCase {
2424
let transactionOperation = "Some Operation"
2525
let maxBreadcrumbs = 5
2626

27-
@available(*, deprecated)
2827
init() {
2928
date = Date(timeIntervalSince1970: 10)
3029

@@ -81,7 +80,6 @@ class SentryScopeSwiftTests: XCTestCase {
8180

8281
private var fixture: Fixture!
8382

84-
@available(*, deprecated)
8583
override func setUp() {
8684
super.setUp()
8785
fixture = Fixture()

0 commit comments

Comments
 (0)