-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MudMenu: Introduce OnClickHandlerAsync to fix #6645 #6648
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #6648 +/- ##
==========================================
- Coverage 90.55% 90.44% -0.11%
==========================================
Files 399 399
Lines 13610 13632 +22
==========================================
+ Hits 12324 12329 +5
- Misses 1286 1303 +17
... and 6 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
To be honest @ScarletKuro, I think we really need the global exception handler in MudBlazor I mentioned earlier. Because I think here a |
I don't agree.
Could you please provide more details on this? It seems that both the community and our team have already identified and fixed several instances where an awaited task was missing. Whether a task is long-running or not does not really matter. In any case, the menu is closed before the task is executed, so even if the task takes hours to complete, it does not impact the user experience. By properly awaiting the task, the UI thread can continue processing, which prevents it from freezing. However, if we were to use |
In the |
Of course you would handle exceptions if you can in WPF, the handler is for observing those you forgot to handle. We may be talking about different things entirely. I was talking about this line:
|
Sure, you are of course right. I think I misread the intention of this PR. |
OK, for everyone's information we established in our discussion on the team that we should never discard tasks as this swallows exceptions silently. I am working on a PR that will introduce a global exception handler for all exceptions caught in |
Updated PR |
Thanks a lot! |
…or#6648) * MudMenu: Introduce OnClickHandlerAsync and await to not swallow Exceptions * AndForget for SetSelectedValueAsync
Description
Resolved issue #6645 by introducing a new API,
OnClickHandlerAsync
, which properly awaitsOnClick.InvokeAsync
to show exceptions.There are still some concerns with
SelectedItem
andSelectedValue
as they call methods that should be awaited. We should avoid overriding the Parameters getter and setters and look for an alternative solution.Additionally, to catch the
MudMenuItem
exception, it's necessary to have theMudPopoverProvider
inside theErrorBoundary
since theMudPopoverProvider
renders the list popover which is a significant disadvantage.How Has This Been Tested?
new unit test + visual check on https://try.mudblazor.com/snippet/GOwnkebdRgyviedF
Types of changes
Checklist:
dev
).