Repository navigation
Conversation
AppAccountsManager read the saved accounts once at launch and never again, so a single failed read left the app logged out until it was force quit. Read the Keychain again when the scene becomes active if no account was found before. Related to Dimillian#2530
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.
Related to #2530
AppAccountsManager reads the saved accounts from the Keychain once, when the shared instance is created at launch, and never reads them again. If that single read returns nothing, for example when the process is started in the background before the device is unlocked after a reboot, the app shows the logged out layout (two tabs, the Add account sheet and the Trending timeline) until it is force quit, even though the account is still in the Keychain.
This change reads the Keychain again when the scene becomes active, but only if no account was found before. When accounts are found, the last used account is restored and the client is rebuilt through the existing path.
Testing, on an iPhone SE (2nd generation) simulator running iOS 27.0: installed this build over a signed in 2.1.4 build with the same bundle identifier, the login carried over. Force quit and relaunch, the login survived. Removed the account items from the simulator Keychain and relaunched, which reproduced the report exactly. Put the items back while the app was running, sent it to the background and back, and the app signed in again without a restart. The same steps on 2.1.4 left the app logged out. Simulator builds use a different Keychain setup from the App Store build (the Keychain access group is only set in Release builds on a device), so the locked device case itself cannot be reproduced in the simulator.