-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix first navigation race condition with main page affectation #4730
Conversation
Since I have provided the reproduction case for my other PR, I made one for this one too. |
This one need more work. |
1563f04
to
f0eb05e
Compare
I think now that the fix is right. |
After some tests in my app, no regression found. |
f0eb05e
to
8e15638
Compare
8e15638
to
3d1ce25
Compare
After several unsuccessful attempts I had the idea to try with the FormsApplicationActivity instead of AppCompat. And the issue was not present it. My attempt was to synchronize OnAttachedToWindow method call with SwitchContentAsync method call, but the root cause was that pages must not be push during OnAttachedToWindow because it's a native call that we dont control when it is called by the native platform below. So I made a blame and found that this code was changed in AppCompat in the PR #1999. |
Hi @rmarinho, I will have some freetime in the coming days, I can help to fix the failing tests. Thanks. |
Hey @kvpt I will step over my embarrassment here about how long this has been in here and I would love to work with you to see if this is still needed and how we can make it happen. |
…like in FormsApplicationActivity.
9598d30
to
706a7ec
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @jfversluis, Yes this fix is still needed. I updated the reproduction case with the latest version of the framework source code to confirm it still reproducible. I regularly rebase this fix above the framework latest version and used it in my apps for almost 3 years now without any issue. Like I say earlier if this fix introduce some issue or break some tests, please let me know. |
Perfect! That sounds like it's been tested pretty well. I will do some more testing as well, could you try out the NuGet that resulted from this build as well? Instructions for that are here. |
Sure, I will do that. |
I confirm that the PR release version work as expected. |
Awesome, thanks for the confirmation! I will have to see if I want to merge this now... Tbh I don't think so. I pretty much got a release ready. I don't want to risk putting in a last-minute breaking change. But I will make sure to merge it for the next one which should then be released in a month or so. Is this the only thing that makes you keep a fork around? |
No problem I understand, I was no longer waiting for the PR to be merged so I can easily wait one more version. My main problem with Xamarin Forms was stability issues, so I made a lot of PR to fix the issues I was having in my apps. |
I'm honored to be the one that will finally get you get rid of this fork :) Sorry it took so long though. Keep your eye on this one! |
Description of Change
Wait for initial page to be loaded before push new pages inside the navigation stack.
Issues Resolved
Platforms Affected
PR Checklist