Skip to content

Commit

Permalink
Disable and obsolete iOS Watchdog termination (#3867)
Browse files Browse the repository at this point in the history
* Disable and obsolete iOS Watchdog termination

* changelog
  • Loading branch information
bruno-garcia authored Jan 6, 2025
1 parent f752d26 commit 7024f37
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### Fixes

- .NET Mobile: Disable and made obsolete the iOS Watchdog termination feature which is based on heuristics that don't work in .NET ([#3867](https://github.com/getsentry/sentry-dotnet/pull/3867))


### Dependencies

- Bump Native SDK from v0.7.16 to v0.7.17 ([#3857](https://github.com/getsentry/sentry-dotnet/pull/3857))
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Cocoa/BindableSentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public void ApplyTo(SentryOptions.NativeOptions options)
options.EnableFileIOTracing = EnableFileIOTracing ?? options.EnableFileIOTracing;
options.EnableNetworkBreadcrumbs = EnableNetworkBreadcrumbs ?? options.EnableNetworkBreadcrumbs;
options.EnableNetworkTracking = EnableNetworkTracking ?? options.EnableNetworkTracking;
#pragma warning disable CS0618 // Type or member is obsolete
options.EnableWatchdogTerminationTracking = EnableWatchdogTerminationTracking ?? options.EnableWatchdogTerminationTracking;
#pragma warning restore CS0618 // Type or member is obsolete
options.EnableSwizzling = EnableSwizzling ?? options.EnableSwizzling;
options.EnableUIViewControllerTracing = EnableUIViewControllerTracing ?? options.EnableUIViewControllerTracing;
options.EnableUserInteractionTracing = EnableUserInteractionTracing ?? options.EnableUserInteractionTracing;
Expand Down
11 changes: 7 additions & 4 deletions src/Sentry/Platforms/Cocoa/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ internal NativeOptions(SentryOptions options)
public bool EnableNetworkTracking { get; set; } = true;

/// <summary>
/// Whether to enable watchdog termination tracking or not.
/// The default value is <c>true</c> (enabled).
/// Whether to enable watchdog termination tracking or not. NOT advised.
/// The default value is <c>false</c> (disabled).
/// </summary>
/// <remarks>
/// https://docs.sentry.io/platforms/apple/configuration/watchdog-terminations/
/// This feature is prone to false positives on .NET since it relies on heuristics that don't work in this environment.
/// </remarks>
public bool EnableWatchdogTerminationTracking { get; set; } = true;
/// <seealso href="https://github.com/getsentry/sentry-dotnet/issues/3860" />
/// <seealso href="https://docs.sentry.io/platforms/apple/configuration/watchdog-terminations/" />
[Obsolete("See: https://github.com/getsentry/sentry-dotnet/issues/3860")]
public bool EnableWatchdogTerminationTracking { get; set; } = false;

/// <summary>
/// Whether the SDK should use swizzling or not.
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Cocoa/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ private static void InitSentryCocoaSdk(SentryOptions options)
nativeOptions.EnableFileIOTracing = options.Native.EnableFileIOTracing;
nativeOptions.EnableNetworkBreadcrumbs = options.Native.EnableNetworkBreadcrumbs;
nativeOptions.EnableNetworkTracking = options.Native.EnableNetworkTracking;
#pragma warning disable CS0618 // Type or member is obsolete
nativeOptions.EnableWatchdogTerminationTracking = options.Native.EnableWatchdogTerminationTracking;
#pragma warning restore CS0618 // Type or member is obsolete
nativeOptions.EnableSwizzling = options.Native.EnableSwizzling;
nativeOptions.EnableUIViewControllerTracing = options.Native.EnableUIViewControllerTracing;
nativeOptions.EnableUserInteractionTracing = options.Native.EnableUserInteractionTracing;
Expand Down

0 comments on commit 7024f37

Please sign in to comment.