-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defer loading of user info until when it's really necessary #537
Conversation
8ab3b5d
to
4ff130c
Compare
6d184ca
to
35c879f
Compare
4ff130c
to
0cb6cd3
Compare
35c879f
to
e028f97
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #537 +/- ##
==========================================
+ Coverage 79.45% 79.60% +0.14%
==========================================
Files 403 403
Lines 10861 10885 +24
Branches 1602 1605 +3
==========================================
+ Hits 8630 8665 +35
+ Misses 1585 1575 -10
+ Partials 646 645 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge activity
|
0cb6cd3
to
94eb7bf
Compare
e028f97
to
41b9ac8
Compare
Goal
UserInfo was being loaded form preferences way before we actually need it, which delays the execution of startup on the main thread.
Instead, we defer this to when it's consumed by putting it behind a provider which will be executed when it's first read. Access to the in-memory copy is synchronized, which shouldn't impact runtime very much.
This also fixes an existing race condition where concurrent modification could result in some values being lost, though it's probably not very likely.
Testing
Existing tests cover these workflows