Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't add WinUI integration on mobile #2821

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ Additionally, we're dropping support for some of the old target frameworks, plea
- Contexts now inherits from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. ([#2729](https://github.com/getsentry/sentry-dotnet/pull/2729))
- Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously the leading forward slash was missing for some endpoints. ([#2808](https://github.com/getsentry/sentry-dotnet/pull/2808))

### Fixes

- Don't add WinUI exception integration on mobile platforms ([#2821](https://github.com/getsentry/sentry-dotnet/pull/2821))

### Features

#### Native AOT
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be OK. Technically you can target WinUI 3 from a .NET MAUI app - I'm not sure what the value of __MOBILE__ will hold in that case. It doesn't sound, logically, like a mobile app but possibly worth double checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried running the MAUI sample on Widnows but it doesn't seem to work for me.

Docs say MOBILE is defined for iOS and Android

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET5_0_OR_GREATER
#if NET5_0_OR_GREATER && !__MOBILE__
using Sentry.Extensibility;
using Sentry.Internal;

Expand Down
6 changes: 3 additions & 3 deletions src/Sentry/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal IEnumerable<ISdkIntegration> Integrations
}
#endif

#if NET5_0_OR_GREATER
#if NET5_0_OR_GREATER && !__MOBILE__
if ((_defaultIntegrations & DefaultIntegrations.WinUiUnhandledExceptionIntegration) != 0)
{
yield return new WinUIUnhandledExceptionIntegration();
Expand Down Expand Up @@ -1184,7 +1184,7 @@ public SentryOptions()
#if HAS_DIAGNOSTIC_INTEGRATION
| DefaultIntegrations.SentryDiagnosticListenerIntegration
#endif
#if NET5_0_OR_GREATER
#if NET5_0_OR_GREATER && !__MOBILE__
| DefaultIntegrations.WinUiUnhandledExceptionIntegration
#endif
;
Expand Down Expand Up @@ -1283,7 +1283,7 @@ internal enum DefaultIntegrations
#if HAS_DIAGNOSTIC_INTEGRATION
SentryDiagnosticListenerIntegration = 1 << 5,
#endif
#if NET5_0_OR_GREATER
#if NET5_0_OR_GREATER && !__MOBILE__
WinUiUnhandledExceptionIntegration = 1 << 6,
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/SentryOptionsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void DisableNetFxInstallationsIntegration(this SentryOptions optio
public static void DisableAppDomainProcessExitFlush(this SentryOptions options) =>
options.RemoveDefaultIntegration(SentryOptions.DefaultIntegrations.AppDomainProcessExitIntegration);

#if NET5_0_OR_GREATER
#if NET5_0_OR_GREATER && !__MOBILE__
/// <summary>
/// Disables WinUI exception handler
/// </summary>
Expand Down