DialogService: Fix thread is not associated with the Dispatcher#9306
Conversation
…atcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #9306 +/- ##
==========================================
+ Coverage 89.82% 90.60% +0.77%
==========================================
Files 412 403 -9
Lines 11878 12661 +783
Branches 2364 2447 +83
==========================================
+ Hits 10670 11472 +802
+ Misses 681 633 -48
- Partials 527 556 +29 ☔ View full report in Codecov by Sentry. |
|
Hi, |
|
Thanks,But I guess it will cause other bugs if i call InvokeAsync without awaiting it |
|
Maybe we can make the change in an unbreaking way. How about adding Of course both need to be fired for backwards compatibility. Either that or we don't change the event signature and fire it only after awaiting. |
|
thanks for your suggestions,i will try to make the change,by the way,how to test it? |
|
Not sure if it can be tested |
|
Do you have an example of code when you get that exception? |
|
|
|
I found the problem,the dialog parameter is a singleton,it causes some errors when opening multiple windows |
Do you mean if you reuse existing |
|
yes |
Did in a non breaking fashion. I tried to write a test, that would create dialog in a non UI thread but in bUnit it still passes regardless, so I guess let's continue without a test. |
Nvm, I wrote a test that seems to work. If we remove the |
|
Awesome! Thank you both! |
Description
DialogService: The current thread is not associated with the Dispatcher.
Use I
nvokeAsync()to switch execution to the Dispatcher when triggering rendering or component stateHow Has This Been Tested?
Unit test.
Type of Changes
Checklist
dev).