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-1766: fix 500,404 error in POST request when login #1946

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

sherlockvn
Copy link
Collaborator

@sherlockvn sherlockvn commented Jul 11, 2024

Ticket

Related issue
#1766

Root cause

If this is a bug, please provide a brief description of the root cause of the issue
We create the bootstrap dialog at the wrong time, so the state of bootstrap dialog always be newSSSSKey, that means, it will call to POST request to upload new key no matter what even when you have got the recovery key success before in tom server.

Solution

Outline the implemented solution, detailing the changes made and how they address the issue
The solution is direct. We move the creating bootstrap dialog after we have loaded successfully the roomData and accountData from homeserver. This will make sure that the bootstrap state is correct and will not call to upload recoveryKey everytime we log in.

Impact description

If this is not a bug, please explain how the changes affect the project
Can decrypt message with new account now.

Test recommendations

Recommendations for how to test this, or anything else you are worried about?

  1. Create a new account (make sure you follow every steps)
  2. Create an encrypted chat
  3. Send some messages in encrypted chat, then wait for the messages is sent.
  4. Log out and log in again
  5. You will see that the messages in encrypted chat has been decrypted.

Pre-merge

Does anything else need to be done before merging?
no.

Resolved

Attach screenshots or videos demonstrating the changes

  • Web:
Screen.Recording.2024-07-11.at.16.06.51.mov
  • Android:
  • IOS:
RPReplay_Final1720689551.MP4

Copy link

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

@Te-Z
Copy link
Contributor

Te-Z commented Jul 11, 2024

Tested on android, chrome, edge, firefox. LGTM

@hoangdat
Copy link
Member

hoangdat commented Jul 11, 2024

For this ticket, please note the cases we use to test

  • Test with brand new twake account, sign in to app, test in encrypted group, then logout and login again
  • Test with matrix account which you have a good backup by self recovery key
  • ...

Please add more cases, we should maintain these test case to verify problem of backup.

@sherlockvn
Copy link
Collaborator Author

case 1:

Screen.Recording.2024-07-12.at.11.33.59.mov

@sherlockvn
Copy link
Collaborator Author

sherlockvn commented Jul 12, 2024

case 2:

Screen.Recording.2024-07-12.at.11.46.24.mov

@sherlockvn
Copy link
Collaborator Author

case 3: import backup key from mobile

Screen.Recording.2024-07-12.at.11.58.52.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.

Tested again on android and chrome. Works fine

@sherlockvn sherlockvn changed the title TW-1766: fix 500 error in POST request when login TW-1766: fix 500,404 error in POST request when login Jul 15, 2024
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.

LGTM

@Te-Z Te-Z merged commit 9cc656a into main Jul 17, 2024
7 checks passed
@Te-Z Te-Z deleted the TW-1766/cannot-decrypt-message-when-log-in branch July 17, 2024 08:26
@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.

4 participants