Skip to content

Commit c7beb0c

Browse files
committed
fix: Fix watchdog tracking on V9
1 parent a4c5ddc commit c7beb0c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Sources/Sentry/SentryBaseIntegration.m

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,14 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
186186
BOOL performanceDisabled
187187
= !options.enableAutoPerformanceTracing || !options.isTracingEnabled;
188188
BOOL appHangsV2Disabled = options.isAppHangTrackingV2Disabled;
189+
# if SDK_V9
190+
BOOL watchdogDisabled = !options.enableWatchdogTerminationTracking;
191+
# else
192+
// Before V9 this should have no effect so set it to YES
193+
BOOL watchdogDisabled = YES;
194+
# endif // SDK_V9
189195

190-
if (performanceDisabled && appHangsV2Disabled) {
196+
if (performanceDisabled && appHangsV2Disabled && watchdogDisabled) {
191197
if (appHangsV2Disabled) {
192198
SENTRY_LOG_DEBUG(@"Not going to enable %@ because enableAppHangTrackingV2 is "
193199
@"disabled or the appHangTimeoutInterval is 0.",
@@ -200,6 +206,15 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
200206
self.integrationName);
201207
}
202208

209+
# if SDK_V9
210+
if (watchdogDisabled) {
211+
SENTRY_LOG_DEBUG(
212+
@"Not going to enable %@ because enableWatchdogTerminationTracking "
213+
@"is disabled.",
214+
self.integrationName);
215+
}
216+
# endif // SKD_V9
217+
203218
return NO;
204219
}
205220
#endif // SENTRY_HAS_UIKIT

0 commit comments

Comments
 (0)