Skip to content

Commit 733dc11

Browse files
Revert "feat(v9): Remove app hang v2 option from SDK v9 (getsentry#5615)"
This reverts commit 04ff3ec.
1 parent 9dcc944 commit 733dc11

File tree

6 files changed

+3
-47
lines changed

6 files changed

+3
-47
lines changed

CHANGELOG-v9.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,3 @@ Removes unused SentryLogLevel (#5591)
77
Removes deprecated getStoreEndpoint (#5591)
88
Removes deprecated useSpan function (#5591)
99
Removes deprecated SentryDebugImageProvider class (#5598)
10-
Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)
11-
Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
12-
Removes public SentrySerializable conformance from many public models (#5636)
13-
Removes Decodable conformances from the public API of model classes (#5691)
14-
Removes enableTracing property from SentryOptions (#5694)
15-
Removes `integrations` property from `SentryOptions` (#5749)
16-
17-
### Fixes
18-
19-
Fixes warnings about minimum OS version being lower than Xcode supported version (#5591)
20-
21-
### Improvements

Sources/Sentry/Public/SentryOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull
663663

664664
#if SENTRY_UIKIT_AVAILABLE
665665

666-
# if !SDK_V9
667666
/**
668667
* AppHangTrackingV2 can differentiate between fully-blocking and non-fully blocking app hangs.
669668
* fully-blocking app hang is when the main thread is stuck completely, and the app can't render a
@@ -683,8 +682,6 @@ typedef void (^SentryProfilingConfigurationBlock)(SentryProfileOptions *_Nonnull
683682
*/
684683
@property (nonatomic, assign) BOOL enableAppHangTrackingV2;
685684

686-
# endif // !SDK_V9
687-
688685
/**
689686
* When enabled the SDK reports non-fully-blocking app hangs. A non-fully-blocking app hang is when
690687
* the app appears stuck to the user but can still render a few frames. For more information see @c

Sources/Sentry/SentryANRTrackingIntegration.m

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ - (BOOL)installWithOptions:(SentryOptions *)options
5151
}
5252

5353
#if SENTRY_HAS_UIKIT
54-
# if SDK_V9
55-
BOOL isV2Enabled = YES;
56-
# else
57-
BOOL isV2Enabled = options.enableAppHangTrackingV2;
58-
# endif // SDK_V9
5954
self.tracker =
6055
[SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval
61-
isV2Enabled:isV2Enabled];
56+
isV2Enabled:options.enableAppHangTrackingV2];
6257
#else
6358
self.tracker =
6459
[SentryDependencyContainer.sharedInstance getANRTracker:options.appHangTimeoutInterval];
@@ -162,15 +157,9 @@ - (void)anrDetectedWithType:(enum SentryANRType)type
162157
event.debugMeta = [self.debugImageProvider getDebugImagesFromCacheForThreads:event.threads];
163158

164159
#if SENTRY_HAS_UIKIT
165-
# if SDK_V9
166-
BOOL isV2Enabled = YES;
167-
# else
168-
BOOL isV2Enabled = self.options.enableAppHangTrackingV2;
169-
# endif // SDK_V9
170-
171160
// We only measure app hang duration for V2.
172161
// For V1, we directly capture the app hang event.
173-
if (isV2Enabled) {
162+
if (self.options.enableAppHangTrackingV2) {
174163
// We only temporarily store the app hang duration info, so we can change the error message
175164
// when either sending a normal or fatal app hang event. Otherwise, we would have to rely on
176165
// string parsing to retrieve the app hang duration info from the error message.
@@ -198,11 +187,9 @@ - (void)anrStoppedWithResult:(SentryANRStoppedResult *_Nullable)result
198187
{
199188
#if SENTRY_HAS_UIKIT
200189
// We only measure app hang duration for V2, and therefore ignore V1.
201-
# if !SDK_V9
202190
if (!self.options.enableAppHangTrackingV2) {
203191
return;
204192
}
205-
# endif // !SDK_V9
206193

207194
if (result == nil) {
208195
SENTRY_LOG_WARN(@"ANR stopped for V2 but result was nil.")

Sources/Sentry/SentryBaseIntegration.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,10 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
7878

7979
if (integrationOptions & kIntegrationOptionEnableAppHangTracking) {
8080
#if SENTRY_HAS_UIKIT
81-
# if SDK_V9
82-
if (!options.enableAppHangTracking) {
83-
[self logWithOptionName:@"enableAppHangTracking"];
84-
return NO;
85-
}
86-
# else
8781
if (!options.enableAppHangTracking && !options.enableAppHangTrackingV2) {
8882
[self logWithOptionName:@"enableAppHangTracking && enableAppHangTrackingV2"];
8983
return NO;
9084
}
91-
# endif
9285
#else
9386
if (!options.enableAppHangTracking) {
9487
[self logWithOptionName:@"enableAppHangTracking"];

Sources/Sentry/SentryOptions.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ - (instancetype)init
109109
self.enableUserInteractionTracing = YES;
110110
self.idleTimeout = SentryTracerDefaultTimeout;
111111
self.enablePreWarmedAppStartTracing = NO;
112-
# if !SDK_V9
113112
self.enableAppHangTrackingV2 = NO;
114-
# endif // !SDK_V9
115113
self.enableReportNonFullyBlockingAppHangs = YES;
116114
#endif // SENTRY_HAS_UIKIT
117115

@@ -810,12 +808,7 @@ - (void)setEnableSpotlight:(BOOL)value
810808
#if SENTRY_HAS_UIKIT
811809
- (BOOL)isAppHangTrackingV2Disabled
812810
{
813-
# if SDK_V9
814-
BOOL isV2Enabled = self.enableAppHangTracking;
815-
# else
816-
BOOL isV2Enabled = self.enableAppHangTrackingV2;
817-
# endif // SDK_V9
818-
return !isV2Enabled || self.appHangTimeoutInterval <= 0;
811+
return !self.enableAppHangTrackingV2 || self.appHangTimeoutInterval <= 0;
819812
}
820813
#endif // SENTRY_HAS_UIKIT
821814

Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ import Foundation
4343
}
4444

4545
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
46-
#if !SDK_V9
4746
if options.enableAppHangTrackingV2 {
4847
features.append("appHangTrackingV2")
4948
}
50-
#endif // !SDK_V9
5149
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
5250

5351
if options.enablePersistingTracesWhenCrashing {

0 commit comments

Comments
 (0)