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: Add WinUIUnhandledExceptionIntegration on Windows only #3055

Merged
merged 9 commits into from
Jan 19, 2024

Conversation

bitsandfoxes
Copy link
Contributor

Fixes #3050

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (feabf09) 76.42% compared to head (83b1a43) 76.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3055      +/-   ##
==========================================
- Coverage   76.42%   76.42%   -0.01%     
==========================================
  Files         351      351              
  Lines       13262    13263       +1     
  Branches     2646     2646              
==========================================
  Hits        10136    10136              
- Misses       2449     2450       +1     
  Partials      677      677              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -186,7 +186,7 @@ internal IEnumerable<ISdkIntegration> Integrations
}
#endif

#if NET5_0_OR_GREATER && !__MOBILE__
#if NET5_0_OR_GREATER && WINDOWS
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean building for net8.0 for example won't have this handler and is that by design?
Sounds right to me, but checking, if a WInUI app has to always be built with net8.0-windowsXYZ or something.

Copy link
Member

Choose a reason for hiding this comment

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

@lucas-zimerman might know

Copy link
Member

Choose a reason for hiding this comment

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

Note: we don't have a net8.0-windows target in the SDK so I think this isn't getting what you expect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a big TIL. So we have to check during runtime whether to add it depending on the current platform.

Copy link
Collaborator

Choose a reason for hiding this comment

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

to be honest I don't follow about the support of UnhandledException on .NET 8.

Copy link
Member

Choose a reason for hiding this comment

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

This is a big TIL. So we have to check during runtime whether to add it depending on the current platform.

yeah all the compiler flags affect the DLLs we output. And net8.0 is platform agnostic so ANDROID/WINDOWS/etc wil not be set.

public Task Integrations_default_ones_are_properly_registered()
{
// Windows additionally adds `WinUIUnhandledExceptionIntegration`
Skip.If(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Copy link
Member

Choose a reason for hiding this comment

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

should we have two tests then? one that tests we have this on Windows? Instead of skipping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had that but it messed with the verify. I guess I need to run this on windows then too to generate the expected file?

Copy link
Member

Choose a reason for hiding this comment

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

yeah you need to have a file per platform, just saw this on another PR:
image

Copy link
Member

Choose a reason for hiding this comment

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

one of those per OS I imagine

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

approving to unblock but best finding out a way to test it instead of skipping on Windows

@bitsandfoxes bitsandfoxes merged commit d3f2f7a into main Jan 19, 2024
20 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/winui-window-only branch January 19, 2024 10:00
@bruno-garcia
Copy link
Member

approving to unblock but best finding out a way to test it instead of skipping on Windows

@bitsandfoxes is there a ticket to track this? good to link to this PR

@bitsandfoxes
Copy link
Contributor Author

approving to unblock but best finding out a way to test it instead of skipping on Windows

@bitsandfoxes is there a ticket to track this? good to link to this PR

Follor up PR is here #3063

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip WinUI outside Windows
3 participants