Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #4529, #4427: Resuming after restoring instance state breaks UI #4571

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

colintheshots
Copy link
Contributor

@colintheshots colintheshots commented Aug 6, 2019

This PR fixes several issues having to do with race conditions when session restoration is still happening while the BrowserFragment is starting up. If the session ID comes up null, we don't want to skip initialization, nor do we want to return to the HomeFragment. The solution is deferring UI initialization until onSessionSelected in these cases.

Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

Copy link
Contributor

@csadilek csadilek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That's a big improvement @colintheshots. I've done a round of manual testing too to confirm. There's one use case though we haven't covered / that would regress with this:

  • Load a page
  • Settings -> Delete browsing data (Open tabs, delete)
  • Hit back, and back again

Now the BrowserFragment is created without a session (and there will never be one) so it will remain a white screen forever. We somehow need to differentiate between the two cases here (still loading vs. there actually is no session).

@colintheshots
Copy link
Contributor Author

colintheshots commented Aug 7, 2019

Now the BrowserFragment is created without a session (and there will never be one) so it will remain a white screen forever. We somehow need to differentiate between the two cases here (still loading vs. there actually is no session).

I'll refactor my PR to handle this case as well.

Copy link
Contributor

@csadilek csadilek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

I think this is a big improvement over what we have now! One thing we will likely have to improve in the future is the empty state of BrowserFragment, which is just a white screen right now. If restoring sessions is slow or never completes we'll be showing a white screen. I think we either need a loading screen or think about how to handle that i.e. reference browser shows at least a functioning toolbar.

@colintheshots colintheshots merged commit ef97173 into mozilla-mobile:master Aug 8, 2019
@colintheshots colintheshots deleted the fix4529 branch August 8, 2019 16:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants