Repository navigation
Conversation
The Stats screen started its portal sync on the UI thread, where the network lookup and the portal requests blocked until the portal answered. They now run on the IO dispatcher inside syncPortalHistory, and the screen reads the saved login off the UI thread too. Fixes vinnovateit#233
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #233
the stats screen started its portal sync on the ui thread and the sync looked up the wifi network adn made the portal requests right there
so the window froze till the portal answered up to the request timeouts on each step
reading the saved login also happened on that thread
the network lookup and the portal requests now run on the IO dispatcher inside
syncPortalHistoryso no caller can block on them and the stats screen reads the saved login off the ui thread tooPlatforms: Windows, Linux, macOS (Android already synced from a background scope).
testing
new test in PortalSessionRepositoryTest runs a sync from a single "ui" thread against a slow spoofed portal and checks that the thread keeps running and never does the lookup or the requests so it fails without the change
:desktop:compileKotlinDesktop :core:desktopTest :desktop:desktopTest :cli:buildpasses except from the 17 Windows-only failures main has too (LinuxCredentialStoreTest, JsonKeyValueStoreTest, MacSystemActionsTest)portal assumption
none
the requests are the same, only the thread they run on changed