-
Notifications
You must be signed in to change notification settings - Fork 624
Make isTesterSignedIn more reliable #4493
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
Conversation
Generated by 🚫 Danger |
Coverage Report 1Affected Products
Test Logs |
Size Report 1Affected Products
Test Logs |
Startup Time Report 1Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS. Startup time comparison between the CI merge commit (649e8f3) and the base commit (c785db4) are not available. No macrobenchmark data found for the base commit (c785db4). Analysis for the CI merge commit (649e8f3) can be found at: |
@@ -54,12 +57,14 @@ Task<Boolean> getSignInStatus() { | |||
} | |||
|
|||
boolean getSignInStatusBlocking() { |
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.
Should this method be renamed?
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.
No I don't think so. It still returns the sign in status, and it is still potentially blocking.
I changed getSharedPreferencesBlocking()
to getAndCacheSharedPreferences()
because if I included Blocking
it would be super long and I didn't think it was necessary for the private method name to communicate that it blocks.
There was an edge case where, if the first thing you did when opening the app was to call
signOutTester
, callingisTesterSignedIn
immediately afterwords would returntrue
. This makes a few tweaks which should prevent this from happening in any reasonable scenario:signOutTester()
is calledgetSignInStatusBlocking()
is calledAlso adds some more tests to cover the failure mode, and some general test cleanup.