Conversation
Reopening the app asked for login details again even when the previous session had not expired. Go straight to the home screen when the saved session is still valid and a pin is not in use. A missing account now counts as no session, so a fresh install does not fail this check.
The saved session stays valid for a while after a user logs out, so the login screen sent them straight back to the home screen without asking for anything. Save a marker when a user logs out and when their session pin is deleted, and skip the automatic return to the home screen while that marker is set. Logging in or unlocking with a pin clears it.
Logging out only completed when the server accepted the request. A timeout or a failed secure connection crashed the app, and a rejected request left the user on the settings screen still signed in. Catch every connection error and always sign the user out on the device, whatever the server replies.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3851 +/- ##
=========================================
- Coverage 25.0% 24.6% -0.5%
- Complexity 844 850 +6
=========================================
Files 297 305 +8
Lines 16102 16564 +462
Branches 2689 2765 +76
=========================================
+ Hits 4038 4081 +43
- Misses 11580 11999 +419
Partials 484 484
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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 #3848
Tapping Logout showed the login screen for a moment and then went back to the home screen. The user was never asked for their details and was never really logged out.
The saved session stays valid for a while after logging out, and the login screen treats a valid session as a reason to go straight to the home screen.
What changed
This also brings in the change from #3773, which this fix depends on, so that PR can be closed as superseded. One line from #3773 was left out on purpose:
secureSharedPreference.deleteCredentials()insidelogout().That entry is what
findAccount()uses to match the account, so clearing it stops offline login from working and leaves the online and offline logout paths in different states.The marker added here meets the same goal directly.
Engineer Checklist
strings.xmlfile./gradlew spotlessApplyand./gradlew spotlessCheckto check my code follows the project's style guideCode Reviewer Checklist
strings.xmlfile