From d84a9891a66da9ab5f610bd1b027533d4540339c Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 09:44:30 +0200 Subject: [PATCH 1/9] fix: Dont create transaction for unused ViewControllers --- SentryTestUtils/TestCurrentDateProvider.swift | 4 +-- Sources/Sentry/SentrySpan.m | 2 +- Sources/Sentry/SentrySpanStatus.m | 1 + Sources/Sentry/SentryTracer.m | 28 +++++++++++++------ ...SentryUIViewControllerPerformanceTracker.m | 7 +++-- Sources/Sentry/include/SentrySpan.h | 8 ++++++ .../Helper/SentryCurrentDateProvider.swift | 8 +++--- .../Transaction/SentryTracerTests.swift | 16 ++++++++++- 8 files changed, 55 insertions(+), 19 deletions(-) diff --git a/SentryTestUtils/TestCurrentDateProvider.swift b/SentryTestUtils/TestCurrentDateProvider.swift index 60dcf341f1b..666fc854bbc 100644 --- a/SentryTestUtils/TestCurrentDateProvider.swift +++ b/SentryTestUtils/TestCurrentDateProvider.swift @@ -10,11 +10,9 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider { private var _systemUptime: TimeInterval = 0 public override init() { - } public override func date() -> Date { - defer { if driftTimeForEveryRead { internalDate = internalDate.addingTimeInterval(driftTimeInterval) @@ -56,7 +54,7 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider { } public override func systemTime() -> UInt64 { - return internalSystemTime + return 0 //internalSystemTime } override public func systemUptime() -> TimeInterval { diff --git a/Sources/Sentry/SentrySpan.m b/Sources/Sentry/SentrySpan.m index e76a7683ff0..3595c5e9a95 100644 --- a/Sources/Sentry/SentrySpan.m +++ b/Sources/Sentry/SentrySpan.m @@ -96,7 +96,7 @@ - (instancetype)initWithContext:(SentrySpanContext *)context _spanId = context.spanId; _sampled = context.sampled; _origin = context.origin; - + _shouldIgnore = NO; #if SENTRY_TARGET_PROFILING_SUPPORTED _isContinuousProfiling = [SentrySDK.options isContinuousProfilingEnabled]; if (_isContinuousProfiling) { diff --git a/Sources/Sentry/SentrySpanStatus.m b/Sources/Sentry/SentrySpanStatus.m index e95de8678ef..bea221cc384 100644 --- a/Sources/Sentry/SentrySpanStatus.m +++ b/Sources/Sentry/SentrySpanStatus.m @@ -18,6 +18,7 @@ NSString *const kSentrySpanStatusNameAborted = @"aborted"; NSString *const kSentrySpanStatusNameOutOfRange = @"out_of_range"; NSString *const kSentrySpanStatusNameDataLoss = @"data_loss"; +NSString *const kSentrySpanStatusNameUnused = @"unused"; NSString * nameForSentrySpanStatus(SentrySpanStatus status) diff --git a/Sources/Sentry/SentryTracer.m b/Sources/Sentry/SentryTracer.m index 2001a21da35..694ba1f6d57 100644 --- a/Sources/Sentry/SentryTracer.m +++ b/Sources/Sentry/SentryTracer.m @@ -94,7 +94,7 @@ @implementation SentryTracer { #endif // SENTRY_HAS_UIKIT NSMutableDictionary *_measurements; dispatch_block_t _idleTimeoutBlock; - NSMutableArray> *_children; + NSMutableArray *_children; BOOL _startTimeChanged; NSObject *_idleTimeoutLock; @@ -506,12 +506,12 @@ - (BOOL)hasUnfinishedChildSpansToWaitFor } @synchronized(_children) { - for (id span in _children) { + for (SentrySpan * span in _children) { if (self.shouldIgnoreWaitForChildrenCallback != nil && self.shouldIgnoreWaitForChildrenCallback(span)) { continue; } - if (![span isFinished]) + if (!span.shouldIgnore && ![span isFinished]) return YES; } return NO; @@ -604,6 +604,9 @@ - (void)finishInternal } SentryTransaction *transaction = [self toTransaction]; + if (transaction == nil) { + return; + } #if SENTRY_TARGET_PROFILING_SUPPORTED if (self.isProfiling) { @@ -638,8 +641,8 @@ - (void)trimEndTimestamp NSDate *oldest = self.startTimestamp; @synchronized(_children) { - for (id childSpan in _children) { - if ([oldest compare:childSpan.timestamp] == NSOrderedAscending) { + for (SentrySpan * childSpan in _children) { + if (!childSpan.shouldIgnore && [oldest compare:childSpan.timestamp] == NSOrderedAscending) { oldest = childSpan.timestamp; } } @@ -656,9 +659,14 @@ - (void)updateStartTime:(NSDate *)startTime _startTimeChanged = YES; } -- (SentryTransaction *)toTransaction +- (nullable SentryTransaction *)toTransaction { - + if (self.shouldIgnore) { + //If this transaction was marked as "not used" we drop it. + SENTRY_LOG_WARN(@"Transaction '%@' was not used.", self.transactionContext.name); + return nil; + } + NSUInteger capacity; #if SENTRY_HAS_UIKIT [self addFrameStatistics]; @@ -672,7 +680,11 @@ - (SentryTransaction *)toTransaction NSMutableArray> *spans = [[NSMutableArray alloc] initWithCapacity:capacity]; @synchronized(_children) { - [spans addObjectsFromArray:_children]; + for (SentrySpan * child in _children) { + if (child.shouldIgnore == NO) { + [spans addObject:child]; + } + } } #if SENTRY_HAS_UIKIT diff --git a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m index c7d051e15b0..91bd5772e9f 100644 --- a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m +++ b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m @@ -125,6 +125,9 @@ - (void)createTransaction:(UIViewController *)controller SENTRY_LOG_DEBUG(@"Started span with id %@ to track view controller %@.", spanId.sentrySpanIdString, name); + SentrySpan * span = [self.tracker getSpan:spanId]; + span.shouldIgnore = YES; + // Use the target itself to store the spanId to avoid using a global mapper. objc_setAssociatedObject(controller, &SENTRY_UI_PERFORMANCE_TRACKER_SPAN_ID, spanId, OBJC_ASSOCIATION_RETAIN_NONATOMIC); @@ -264,13 +267,13 @@ - (void)finishTransaction:(UIViewController *)controller }; [self.tracker activateSpan:spanId duringBlock:duringBlock]; - id vcSpan = [self.tracker getSpan:spanId]; + SentrySpan* vcSpan = [self.tracker getSpan:spanId]; // If the current controller span has no parent, // it means it is the root transaction and need to be pop from the queue. if (vcSpan.parentSpanId == nil) { [self.tracker popActiveSpan]; } - + vcSpan.shouldIgnore = NO; // If we are still tracking this UIViewController finish the transaction // and remove associated span id. [self.tracker finishSpan:spanId withStatus:status]; diff --git a/Sources/Sentry/include/SentrySpan.h b/Sources/Sentry/include/SentrySpan.h index acbc382ed96..36f220e9f4e 100644 --- a/Sources/Sentry/include/SentrySpan.h +++ b/Sources/Sentry/include/SentrySpan.h @@ -84,6 +84,14 @@ SENTRY_NO_INIT */ @property (nullable, nonatomic, strong) NSArray *frames; +/** + * Indicates whether this span should be ignored when finishing a transaction. + * Ignored spans are not included in the transaction and not taken in account + * when trimming transaction timeout. + * Default value is @c NO + */ +@property (nonatomic) BOOL shouldIgnore; + /** * Init a @c SentrySpan with given transaction and context. * @param transaction The @c SentryTracer managing the transaction this span is associated with. diff --git a/Sources/Swift/Helper/SentryCurrentDateProvider.swift b/Sources/Swift/Helper/SentryCurrentDateProvider.swift index 2b42c77ecaa..0128184e4c4 100644 --- a/Sources/Swift/Helper/SentryCurrentDateProvider.swift +++ b/Sources/Swift/Helper/SentryCurrentDateProvider.swift @@ -3,19 +3,19 @@ import Foundation @objcMembers class SentryCurrentDateProvider: NSObject { - func date() -> Date { + public func date() -> Date { return Date() } - func timezoneOffset() -> Int { + public func timezoneOffset() -> Int { return TimeZone.current.secondsFromGMT() } - func systemTime() -> UInt64 { + public func systemTime() -> UInt64 { getAbsoluteTime() } - func systemUptime() -> TimeInterval { + public func systemUptime() -> TimeInterval { ProcessInfo.processInfo.systemUptime } } diff --git a/Tests/SentryTests/Transaction/SentryTracerTests.swift b/Tests/SentryTests/Transaction/SentryTracerTests.swift index 207d08043ac..06b63806d31 100644 --- a/Tests/SentryTests/Transaction/SentryTracerTests.swift +++ b/Tests/SentryTests/Transaction/SentryTracerTests.swift @@ -39,7 +39,10 @@ class SentryTracerTests: XCTestCase { let currentDateProvider = TestCurrentDateProvider() var appStart: Date - lazy var appStartSystemTime = currentDateProvider.systemTime() + var appStartSystemTime : UInt64 { + let res = currentDateProvider.systemTime() + return res + } var appStartEnd: Date var appStartDuration = 0.5 let testKey = "extra_key" @@ -1210,6 +1213,17 @@ class SentryTracerTests: XCTestCase { } } + func testRemoveChildWithShouldIgnoreTrue() throws { + let sut = fixture.getSut() + let child = try XCTUnwrap(sut.startChild(operation: fixture.transactionOperation) as? SentrySpan) + child.shouldIgnore = true + + sut.finish() + let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? Transaction) + + XCTAssertEqual(transaction.spans.count, 0) + } + #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) func testChangeStartTimeStamp_OnlyFramesDelayAdded() throws { From 1c45023935e634741b028c7b54be6c06c3e1eec8 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 15:51:05 +0200 Subject: [PATCH 2/9] format --- Sources/Sentry/SentryTracer.m | 13 +++++++------ .../SentryUIViewControllerPerformanceTracker.m | 6 +++--- .../SentryTests/Transaction/SentryTracerTests.swift | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Sources/Sentry/SentryTracer.m b/Sources/Sentry/SentryTracer.m index 694ba1f6d57..2f1fc74616e 100644 --- a/Sources/Sentry/SentryTracer.m +++ b/Sources/Sentry/SentryTracer.m @@ -506,7 +506,7 @@ - (BOOL)hasUnfinishedChildSpansToWaitFor } @synchronized(_children) { - for (SentrySpan * span in _children) { + for (SentrySpan *span in _children) { if (self.shouldIgnoreWaitForChildrenCallback != nil && self.shouldIgnoreWaitForChildrenCallback(span)) { continue; @@ -641,8 +641,9 @@ - (void)trimEndTimestamp NSDate *oldest = self.startTimestamp; @synchronized(_children) { - for (SentrySpan * childSpan in _children) { - if (!childSpan.shouldIgnore && [oldest compare:childSpan.timestamp] == NSOrderedAscending) { + for (SentrySpan *childSpan in _children) { + if (!childSpan.shouldIgnore && + [oldest compare:childSpan.timestamp] == NSOrderedAscending) { oldest = childSpan.timestamp; } } @@ -662,11 +663,11 @@ - (void)updateStartTime:(NSDate *)startTime - (nullable SentryTransaction *)toTransaction { if (self.shouldIgnore) { - //If this transaction was marked as "not used" we drop it. + // If this transaction was marked as "not used" we drop it. SENTRY_LOG_WARN(@"Transaction '%@' was not used.", self.transactionContext.name); return nil; } - + NSUInteger capacity; #if SENTRY_HAS_UIKIT [self addFrameStatistics]; @@ -680,7 +681,7 @@ - (nullable SentryTransaction *)toTransaction NSMutableArray> *spans = [[NSMutableArray alloc] initWithCapacity:capacity]; @synchronized(_children) { - for (SentrySpan * child in _children) { + for (SentrySpan *child in _children) { if (child.shouldIgnore == NO) { [spans addObject:child]; } diff --git a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m index 91bd5772e9f..31cd552a8ce 100644 --- a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m +++ b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m @@ -125,9 +125,9 @@ - (void)createTransaction:(UIViewController *)controller SENTRY_LOG_DEBUG(@"Started span with id %@ to track view controller %@.", spanId.sentrySpanIdString, name); - SentrySpan * span = [self.tracker getSpan:spanId]; + SentrySpan *span = [self.tracker getSpan:spanId]; span.shouldIgnore = YES; - + // Use the target itself to store the spanId to avoid using a global mapper. objc_setAssociatedObject(controller, &SENTRY_UI_PERFORMANCE_TRACKER_SPAN_ID, spanId, OBJC_ASSOCIATION_RETAIN_NONATOMIC); @@ -267,7 +267,7 @@ - (void)finishTransaction:(UIViewController *)controller }; [self.tracker activateSpan:spanId duringBlock:duringBlock]; - SentrySpan* vcSpan = [self.tracker getSpan:spanId]; + SentrySpan *vcSpan = [self.tracker getSpan:spanId]; // If the current controller span has no parent, // it means it is the root transaction and need to be pop from the queue. if (vcSpan.parentSpanId == nil) { diff --git a/Tests/SentryTests/Transaction/SentryTracerTests.swift b/Tests/SentryTests/Transaction/SentryTracerTests.swift index 06b63806d31..40e70f15c6d 100644 --- a/Tests/SentryTests/Transaction/SentryTracerTests.swift +++ b/Tests/SentryTests/Transaction/SentryTracerTests.swift @@ -39,7 +39,7 @@ class SentryTracerTests: XCTestCase { let currentDateProvider = TestCurrentDateProvider() var appStart: Date - var appStartSystemTime : UInt64 { + var appStartSystemTime: UInt64 { let res = currentDateProvider.systemTime() return res } From 288c2bca480c927b7d43e70c3234f1d58827ddc6 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 15:52:28 +0200 Subject: [PATCH 3/9] Update TestCurrentDateProvider.swift --- SentryTestUtils/TestCurrentDateProvider.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SentryTestUtils/TestCurrentDateProvider.swift b/SentryTestUtils/TestCurrentDateProvider.swift index 666fc854bbc..564360c1c68 100644 --- a/SentryTestUtils/TestCurrentDateProvider.swift +++ b/SentryTestUtils/TestCurrentDateProvider.swift @@ -10,9 +10,11 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider { private var _systemUptime: TimeInterval = 0 public override init() { + } public override func date() -> Date { + defer { if driftTimeForEveryRead { internalDate = internalDate.addingTimeInterval(driftTimeInterval) @@ -54,7 +56,7 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider { } public override func systemTime() -> UInt64 { - return 0 //internalSystemTime + return internalSystemTime } override public func systemUptime() -> TimeInterval { From f47d7c69b57be6e7d109f6963d188024a5cffbf6 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 15:52:51 +0200 Subject: [PATCH 4/9] Update TestCurrentDateProvider.swift --- SentryTestUtils/TestCurrentDateProvider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SentryTestUtils/TestCurrentDateProvider.swift b/SentryTestUtils/TestCurrentDateProvider.swift index 564360c1c68..60dcf341f1b 100644 --- a/SentryTestUtils/TestCurrentDateProvider.swift +++ b/SentryTestUtils/TestCurrentDateProvider.swift @@ -14,7 +14,7 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider { } public override func date() -> Date { - + defer { if driftTimeForEveryRead { internalDate = internalDate.addingTimeInterval(driftTimeInterval) From 35ee4ac27fe9292d1640f94c3c05af23b8bff193 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 15:54:21 +0200 Subject: [PATCH 5/9] ref --- Sources/Sentry/SentrySpanStatus.m | 1 - Sources/Swift/Helper/SentryCurrentDateProvider.swift | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/Sentry/SentrySpanStatus.m b/Sources/Sentry/SentrySpanStatus.m index bea221cc384..e95de8678ef 100644 --- a/Sources/Sentry/SentrySpanStatus.m +++ b/Sources/Sentry/SentrySpanStatus.m @@ -18,7 +18,6 @@ NSString *const kSentrySpanStatusNameAborted = @"aborted"; NSString *const kSentrySpanStatusNameOutOfRange = @"out_of_range"; NSString *const kSentrySpanStatusNameDataLoss = @"data_loss"; -NSString *const kSentrySpanStatusNameUnused = @"unused"; NSString * nameForSentrySpanStatus(SentrySpanStatus status) diff --git a/Sources/Swift/Helper/SentryCurrentDateProvider.swift b/Sources/Swift/Helper/SentryCurrentDateProvider.swift index 0128184e4c4..2b42c77ecaa 100644 --- a/Sources/Swift/Helper/SentryCurrentDateProvider.swift +++ b/Sources/Swift/Helper/SentryCurrentDateProvider.swift @@ -3,19 +3,19 @@ import Foundation @objcMembers class SentryCurrentDateProvider: NSObject { - public func date() -> Date { + func date() -> Date { return Date() } - public func timezoneOffset() -> Int { + func timezoneOffset() -> Int { return TimeZone.current.secondsFromGMT() } - public func systemTime() -> UInt64 { + func systemTime() -> UInt64 { getAbsoluteTime() } - public func systemUptime() -> TimeInterval { + func systemUptime() -> TimeInterval { ProcessInfo.processInfo.systemUptime } } From 734f4f3cc7396299dc8060374d83cf76fdfa89c4 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 16:23:23 +0200 Subject: [PATCH 6/9] tests --- ...ViewControllerPerformanceTrackerTests.swift | 2 ++ .../Transaction/SentryTracerTests.swift | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift index abae8db883e..5560fd7a447 100644 --- a/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Performance/UIViewController/SentryUIViewControllerPerformanceTrackerTests.swift @@ -132,6 +132,7 @@ class SentryUIViewControllerPerformanceTrackerTests: XCTestCase { callbackExpectation.fulfill() } let tracer = try XCTUnwrap(transactionSpan as? SentryTracer) + XCTAssertTrue(tracer.shouldIgnore) XCTAssertEqual(tracer.transactionContext.name, fixture.viewControllerName) XCTAssertEqual(tracer.transactionContext.nameSource, .component) XCTAssertEqual(tracer.transactionContext.origin, origin) @@ -193,6 +194,7 @@ class SentryUIViewControllerPerformanceTrackerTests: XCTestCase { lifecycleEndingMethod(sut, viewController, tracker, callbackExpectation, tracer) + XCTAssertFalse(tracer.shouldIgnore) XCTAssertEqual(Dynamic(transactionSpan).children.asArray!.count, 8) XCTAssertTrue(tracer.isFinished) XCTAssertEqual(finishStatus.rawValue, tracer.status.rawValue) diff --git a/Tests/SentryTests/Transaction/SentryTracerTests.swift b/Tests/SentryTests/Transaction/SentryTracerTests.swift index 40e70f15c6d..b7813f8bf93 100644 --- a/Tests/SentryTests/Transaction/SentryTracerTests.swift +++ b/Tests/SentryTests/Transaction/SentryTracerTests.swift @@ -39,10 +39,7 @@ class SentryTracerTests: XCTestCase { let currentDateProvider = TestCurrentDateProvider() var appStart: Date - var appStartSystemTime: UInt64 { - let res = currentDateProvider.systemTime() - return res - } + lazy var appStartSystemTime = currentDateProvider.systemTime() var appStartEnd: Date var appStartDuration = 0.5 let testKey = "extra_key" @@ -1219,9 +1216,16 @@ class SentryTracerTests: XCTestCase { child.shouldIgnore = true sut.finish() - let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? Transaction) - - XCTAssertEqual(transaction.spans.count, 0) + let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? [String:Any]) + let spans = try XCTUnwrap(transaction["spans"]! as? [[String: Any]]) + XCTAssertEqual(spans.count, 0) + } + + func testDontCaptureWithShouldIgnoreTrue() throws { + let sut = fixture.getSut() + sut.shouldIgnore = true + sut.finish() + XCTAssertEqual(fixture.hub.capturedTransactionsWithScope.count, 0) } #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) From a554a06527cf91cb365c58d8d19bd597c60038ea Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 16:47:44 +0200 Subject: [PATCH 7/9] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf55a5be505..41ef80b8431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ via the option `swizzleClassNameExclude`. - Add TTID/TTFD spans when loadView gets skipped (#4415) - Finish TTID correctly when viewWillAppear is skipped (#4417) - Swizzling RootUIViewController if ignored by `swizzleClassNameExclude` (#4407) +- Do not create transaction for unused view controllers (#4437) ### Improvements From ce99e69fe0ef3f261769fce517b6f07bc2e010c3 Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Mon, 14 Oct 2024 14:58:21 +0000 Subject: [PATCH 8/9] Format code --- Tests/SentryTests/Transaction/SentryTracerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/SentryTests/Transaction/SentryTracerTests.swift b/Tests/SentryTests/Transaction/SentryTracerTests.swift index 8200852cf3a..823728986bd 100644 --- a/Tests/SentryTests/Transaction/SentryTracerTests.swift +++ b/Tests/SentryTests/Transaction/SentryTracerTests.swift @@ -1217,7 +1217,7 @@ class SentryTracerTests: XCTestCase { child.shouldIgnore = true sut.finish() - let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? [String:Any]) + let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? [String: Any]) let spans = try XCTUnwrap(transaction["spans"]! as? [[String: Any]]) XCTAssertEqual(spans.count, 0) } From f608ba31268a9f42dfad737e10d86659877fb5cf Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Mon, 14 Oct 2024 16:59:11 +0200 Subject: [PATCH 9/9] Update SentryTracerTests.swift --- Tests/SentryTests/Transaction/SentryTracerTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/SentryTests/Transaction/SentryTracerTests.swift b/Tests/SentryTests/Transaction/SentryTracerTests.swift index b7813f8bf93..16e59f3f356 100644 --- a/Tests/SentryTests/Transaction/SentryTracerTests.swift +++ b/Tests/SentryTests/Transaction/SentryTracerTests.swift @@ -1216,7 +1216,7 @@ class SentryTracerTests: XCTestCase { child.shouldIgnore = true sut.finish() - let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? [String:Any]) + let transaction = try XCTUnwrap(fixture.hub.capturedTransactionsWithScope.first?.transaction as? [String: Any]) let spans = try XCTUnwrap(transaction["spans"]! as? [[String: Any]]) XCTAssertEqual(spans.count, 0) }