This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug] Selected session is incorrect when opening from another app #2181
Labels
🐞 bug
Crashes, Something isn't working, ..
eng:health
Improve code health
eng:qa:verified
QA Verified
Feature:Tabs
Milestone
Comments
Thank you for your investigation! 😄 |
Here is some sample code for the second solution: diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt
index 3867fee..8f93858 100644
--- a/app/src/main/java/org/mozilla/fenix/components/Core.kt
+++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt
@@ -97,7 +97,11 @@ class Core(private val context: Context) {
// There's an active bundle with a snapshot: Feed it into the SessionManager.
snapshot.await()?.let {
try {
+ val selected = sessionManager.selectedSession
sessionManager.restore(it)
+ selected?.let {
+ sessionManager.select(selected)
+ }
} catch (_: IllegalArgumentException) {
return@let
}
|
ekager
added a commit
to ekager/fenix
that referenced
this issue
May 2, 2019
colintheshots
pushed a commit
that referenced
this issue
May 2, 2019
Isn't this the same as #1279? |
Yes it is @sv-ohorvath |
verified this is fixed on the 5/6 build. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
🐞 bug
Crashes, Something isn't working, ..
eng:health
Improve code health
eng:qa:verified
QA Verified
Feature:Tabs
Steps to reproduce
Expected behavior
Actual behavior
@csadilek and I investigated this issue and it seems to be occurring because of the async nature of the session restore which can sometimes be seen in to happen after the selected session was set by the IntentProcessor when an external tab is clicked.
The simplest solution would be to remove the coroutine and allow the updating to happen sequentially during the lazy initialization of the SessionManager.
This might have been added for performance reasons, so an alternative solution would be to hold on to the selected session, restore the state, and then re-set the selected session to it's prior one.
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: