-
Couldn't load subscription status.
- Fork 725
Description
Describe the bug
After #1993 being my fault I put my MessageBox invocations inside Application.MainLoop.Invoke. But since I nevertheless want to await the message boxes I wrote the following helper function that is supposed to allow awaiting the message box:
private static async Task ShowMessageBox (bool isError, ustring title, ustring message, params ustring [] buttons)
{
var tcs = new TaskCompletionSource<int> ();
Application.MainLoop.Invoke (() =>
{
if (isError) {
var result = MessageBox.ErrorQuery (title, message, buttons);
tcs.SetResult (result);
} else {
var result = MessageBox.Query (title, message, buttons);
tcs.SetResult (result);
}
});
_ = await tcs.Task.ConfigureAwait (false);
}That seems to work. Unless it crashes. See reproduction.
To Reproduce
Steps to reproduce the behavior:
- Pull/rebuild/look at the repro from heinrich-ulbricht@ba88e7b - it is the modified Reactive sample showing the changes needed to provoke the error (it adds a ScrollView and the async method from above)
- Launch ReactiveExample
- Enter values and click on "Login" - the message box appears

- While leaving the message box open click some UI elements
The error does not always happen. Keep closing, opening and clicking until it happens.
Am I again wrong in some assumptions here? Async contexts etc.? Or should this work? Note that without the scroll view it works fine.
Expected behavior
I expect the error not to happen.
Desktop (please complete the following information):
- OS: Windows 11
- Version: current dev branch
