-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove non-functioning code and instead throw a more helpful platform-not-supported error #23617
Remove non-functioning code and instead throw a more helpful platform-not-supported error #23617
Conversation
…-not-supported error Also mark the APIs not supported on Windows.
Hey there @dotMorten! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
var decl = doc.Root.XPathSelectElements($"//uap:Extension[@Category='windows.protocol']/uap:Protocol[@Name='{scheme}']", namespaceManager); | ||
|
||
return decl != null && decl.Any(); | ||
throw new PlatformNotSupportedException("This implementation of WebAuthenticator does not support Windows. See https://github.com/microsoft/WindowsAppSDK/issues/441 for more details."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you have a better location to direct people to?
You could direct to https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?view=net-maui-8.0&tabs=windows#get-started, but that just directs to a closed maui issue which is just as confusing, and in turn that just directs to the above referenced issue, which is where the problem really needs to be addressed first.
The doc could be the better place to direct people to, but in that case the doc needs improvements.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build errors across the board!
🤦What was I thinking??? Fixed now |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@mattleibow @jfversluis I'm a little bit confused here. The build is failing on building unit tests that would never work on Windows: https://github.com/dotnet/maui/blob/main/src/Essentials/test/DeviceTests/Tests/WebAuthenticator_Tests.cs#L12 That leaves me a few options:
|
Yep looks like because those require human interaction and thus are automatically excluded: https://github.com/dotnet/maui/blob/61e984eb01fa8fa7fd7133a68bd76008865a01a0/src/Essentials/test/DeviceTests/Traits.cs#L41C27-L41C36 Out of the options I think 3 might be best. That way, when we do implement it, we'll end up with a failing test and make sure to implement it/enable the existing test(s) for Windows |
@jfversluis Thanks. I've made the recommended changes. I don't have a clue how to actually run these human tests though, so going off of the behavior I saw by running the code in a separate app. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
…-not-supported error (#23617) * Remove non-functioning code and instead throw a more helpful platform-not-supported error Also mark the APIs not supported on Windows. * Fix build failures * Update tests for new webauth behavior
Description of Change
Removes old UWP code that will never work in a WinUI context. Instead throws a more helpful
PlatformNotSupportedException
and flags the API as unsupported on Windows.The current experience is you first get a "add protocol to manifest" error, but addressing that, you then just get a COMException and you're no closer to finding out what the problem is.
This error will lead users to start looking for alternatives, rather than trying to troubleshoot the problem.
Issues Fixed
Fixes #23616