Skip to content
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

Tw 1900: IOS is forced to log out many times #1921

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

sherlockvn
Copy link
Contributor

Issue:

#1900

How to reproduce:

  • in your iphone, lock the iphone and make sure the Twake Chat is terminated. Wait for a notification from encrypted room to come, when the notification appear in the screen, wait for 5-10 second, then unlock the iphone, click the notification, the user will be redirect to /twakeWelcome page.

  • Logs:
    image

Root cause:

  • When the device are locked, Twake chat can't access to the keychain storage, then because of the twake chat is terminated, the app need to run from main() again, in main method, it need to create client again. When creating a new client, the old logic need to write data to the Keychain -> this operation will throw an exception at runtime, and the client is null -> user is log out

Solution:

add a try/catch in the write operation to keychain, so that if its failed, it still return the old client. Make the access to keychain storage to lowest (which is KeychainAccessibility.first_unlock_this_device), this will make sure we don't hvae this error anymore.

Demo:

RPReplay_Final1720133037.MP4

Copy link

github-actions bot commented Jul 4, 2024

This PR has been deployed to https://linagora.github.io/twake-on-matrix/1921

@hoangdat
Copy link
Member

hoangdat commented Jul 5, 2024

Can you reproduce issue 100%?

@sherlockvn
Copy link
Contributor Author

Can you reproduce issue 100%?

Yeah. 100% now

@sherlockvn
Copy link
Contributor Author

sherlockvn commented Jul 5, 2024

  • Reproduceable video
Screen.Recording.2024-07-05.at.10.28.17.mov

Copy link
Contributor

@Te-Z Te-Z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test on iOS but this looks good. @nqhhdev could you test it please ?

Copy link
Member

@nqhhdev nqhhdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was built it and test on my iphone. LGMT

@Te-Z Te-Z merged commit 4fb3d41 into main Jul 9, 2024
7 checks passed
@Te-Z Te-Z deleted the TW-1900/ios-is-forced-to-log-out-many-times branch July 9, 2024 05:15
@nqhhdev nqhhdev mentioned this pull request Jul 18, 2024
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.

5 participants