-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Bug when navigating and sending a Cmd at the same time #158
Comments
Ok, so I investigated this issue.
Currently Fabulous is fully synchronous and works on the main thread. When a call to the Those calls are too close in time, not letting enough time for the first I think the way to fix this is to properly await
Any attempt to synchronously await will result in a deadlock, as both Fabulous and Xamarin.Forms will need the main thread to complete PopAsync. Making @dsyme What do you think? |
Planning it for a v2.0 release because it would need to make the whole update loop asynchronous to support awaiting PopAsync |
v2 fixes this bug :) |
Applies to: iOS and Android
Description:
One common use case in apps is to provide some kind of action when back navigating.
As an example, when you click the "Save" button on an edit page, you want to save the fields, navigate back to the previous page and update the previous page to reflect the changes as well.
The best way I found to handle that is to:
This works, but when using NavigationPage, this also triggers 2 rounds of PopAsync.
Because for some reason, Cmd keeps its own set of previous values and when
updateNavigationPage
is called for the Cmd, it sees the previous values and thinks it should pop the last page a second time, which is not correct.Repro:
https://github.com/TimLariviere/EXF_NavigationAndCmd
Workaround:
I have found that if I don't do navigation and Cmd at the same time the bug doesn't trigger.
Thus we can store the Cmd in the model and wait for
NavigationPopped
to signal that the navigation has endedThe text was updated successfully, but these errors were encountered: