I just saw this and it's quite disruptive.
After further investigation I found out that you need to be logged in to reproduce the bug.
I discovered that commenting the code inside onAuthenticated will no longer reproduce the bug.
Another interesting thing is that if you open the app and don't press the 3 dot menu 3 callbacks related to FxaAccount will be triggered:
1) in HomeMenu.kt - line
2) in Mode.kt - line
3) in HomeFragment.kt - line
If you open the app and press fast the 3 dot menu (in order to reproduce the bug), only the callback from HomeMenu.kt will be triggered. After commenting this line, 2 and 3 triggers.
Checked notifyObservers method and seems like if you press the 3 dot menu, it will not notify the same observers as when you open the app and don't press anything.
You can check this log to see what observers are notified in each case:
1) When you don't press the 3 dot menu
Same observers
...
mozilla.components.service.fxa.sync.SyncManager$PassThroughSyncStatusObserver@f80bdeb
mozilla.components.service.fxa.manager.FxaAccountManager$SyncToAccountsIntegration@13aef34
org.mozilla.fenix.components.AccountAbnormalities@fd57ad2
org.mozilla.fenix.home.HomeMenu$4$1@225eaff
org.mozilla.fenix.home.CurrentMode@2e9922a
org.mozilla.fenix.home.HomeFragment$onStart$1$1@a2a4db8
mozilla.components.service.fxa.manager.FxaAccountManager$AccountsToSyncIntegration@6e0c207
org.mozilla.fenix.components.TelemetryAccountObserver@131e15d
org.mozilla.fenix.components.AccountAbnormalities@fd57ad2
org.mozilla.fenix.home.HomeMenu$4$1@225eaff
org.mozilla.fenix.home.CurrentMode@2e9922a
org.mozilla.fenix.home.HomeFragment$onStart$1$1@a2a4db8
2) When you press the 3 dot menu
Same observers
...
org.mozilla.fenix.components.AccountAbnormalities@7ce3c82
org.mozilla.fenix.home.HomeMenu$4$1@60024fc
mozilla.components.service.fxa.sync.SyncManager$PassThroughSyncStatusObserver@baf9d8d
mozilla.components.service.fxa.manager.FxaAccountManager$SyncToAccountsIntegration@66a6f6
I hope this helps solving the issue.
@grigoryk I saw that you refactored HomeMenu-HomeFragment interaction. Can you take a look on this?
This has been happening for me occasionally for about a month. Sometimes the triple dot menu doesn't close when I open bookmarks or settings from it ๐ค
This reproduces reliably for me.
Problem was that we were trying to process menu changes (in response to account manager events) on some background thread as that's what account manager emits them on, so some code internally in PopupWindow's dismiss handling (i think, didn't dig very deeply here) was silently giving up and we'd get into a bad state.
The reason this seemingly only happened if you quickly opened a menu on startup is because account manager isn't initialized until sometime after the startup finished. So the trick was to open the menu (and register account manager state callbacks) _before_ it got initialized, so that the callbacks are invoked.
This should also reproduce in other, much more obscure ways, e.g. if you open the menu right before sync is scheduled to run in the background, change FxA password on another connected client, and then eventually receive a onAuthenticationProblem callback.
Patch incoming.
Thanks for explaining, I suppose this thread can be closed now ๐
Once we land the patch and verify that it is, indeed, fixed :)
Great!
@ValentinTimisica #10863 should be on nightly by now, can you verify that this doesn't happen anymore? Thanks :)
Tested and it doesn't stuck anymore for me but I saw that the 3 dot menu is automatically dismissed after a few seconds. @grigoryk is this intended?
Adding the QA label for an extra check.
Yeah @grigoryk mentioned in the #10863
One "problem" this introduces is that if you open the menu right after the startup, it will be dismissed in a few seconds (as account manager is initialized). Fixing that will require changes to a-c, so I'll leave that to a follow-up.
Is there an AC bug open for this Grisha?
Thanks @ekager, I missed this info when I tested earlier. That means it works well for me now.
Thanks, @ValentinTimisica ! I'll close this issue for now then.
Hi, issue is fixed, i cannot reproduce it, checked with Samsung Galaxy S9 (Android 8) and Google Pixel 3 XL (Android 9) on Beta 5.2.0-beta.1 GV:78.0
Most helpful comment
After further investigation I found out that you need to be logged in to reproduce the bug.
I discovered that commenting the code inside onAuthenticated will no longer reproduce the bug.
Another interesting thing is that if you open the app and don't press the 3 dot menu 3 callbacks related to FxaAccount will be triggered:
1) in
HomeMenu.kt- line2) in
Mode.kt- line3) in
HomeFragment.kt- lineIf you open the app and press fast the 3 dot menu (in order to reproduce the bug), only the callback from
HomeMenu.ktwill be triggered. After commenting this line, 2 and 3 triggers.Checked notifyObservers method and seems like if you press the 3 dot menu, it will not notify the same observers as when you open the app and don't press anything.
You can check this log to see what observers are notified in each case:
1) When you don't press the 3 dot menu
2) When you press the 3 dot menu
I hope this helps solving the issue.
@grigoryk I saw that you refactored HomeMenu-HomeFragment interaction. Can you take a look on this?