Skip to content

[Fix]: Keep the window responsive while history syncs - #235

Open
Dx-Alz-xD wants to merge 1 commit into
vinnovateit:mainfrom
Dx-Alz-xD:fix-stats-sync-blocking
Open

Dx-Alz-xD wants to merge 1 commit into
vinnovateit:mainfrom
Dx-Alz-xD:fix-stats-sync-blocking

Conversation

@Dx-Alz-xD

Copy link
Copy Markdown
Contributor

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 syncPortalHistory so no caller can block on them and the stats screen reads the saved login off the ui thread too

Platforms: 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:build passes 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

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resyncing stat history is blocking

1 participant