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

Messages get completely stuck at "Encrypting your message" #24612

Closed
richvdh opened this issue Feb 22, 2023 · 6 comments · Fixed by matrix-org/matrix-react-sdk#12630
Closed
Labels
A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Awaiting-Element-R Issues in code which will be replaced by the port of Element's crypto layer to Rust

Comments

@richvdh
Copy link
Member

richvdh commented Feb 22, 2023

Note: this is distinct from #15476, in which messages are slow to send but do get sent eventually.

There is a bug in which sometimes the encryption process gets completely stuck, with messages staying in the "encrypting" state for 15 minutes or more.

@richvdh
Copy link
Member Author

richvdh commented Feb 22, 2023

Looking at a recent rageshake which exhibits this (https://github.com/matrix-org/element-web-rageshakes/issues/19899), it seems like we've got stuck trying to make an Olm session for a particular device, and all attempts at encryption for this device are then blocking. Unfortunately the logs don't seem to go back far enough to show it getting stuck.

The code which manages this is in olmlib.ensureOlmSessionsForDevices. It looks robust, but it's also really quite complex and it's hard to be certain that it is robust.

Ideally, we would refactor it so that we can be more certain that it will catch all the error cases, but that's a non-trivial amount of work, and we're going to replace this bit of code for #21972.

I'd still be interested in rageshakes from anyone seeing this behaviour, as they might point towards a quick fix.

@weeman1337 weeman1337 added S-Major Severely degrades major functionality or product features, with no satisfactory workaround A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely T-Defect labels Feb 23, 2023
@davidegirardi
Copy link

I restarted Element Desktop Nightly and the 2 stuck messages disappeared, while the UTDs are now decrypted with a grey shield.

@uhoreg
Copy link
Member

uhoreg commented May 19, 2023

FWIW, the first time I encountered this issue in a rageshake was shortly after matrix-org/matrix-js-sdk#3035 landed, which looks like it might touch some relevant code, but I didn't see anything in that PR that looked like it could cause this breakage. I don't remember seeing any reports of this before that time, so it seems to be a recent issue.

@golam71
Copy link

golam71 commented Apr 23, 2024

so as of now all of my messages stay on this state so far even after waiting a hour and re trying i am not been able to send a single message
this issue is from 2023 a year has passed so what now ?
if i cant even send any message whats the point of using it then?
is there even any walkaround for it?

@richvdh
Copy link
Member Author

richvdh commented Apr 23, 2024

The rust cryptography stack will resolve this issue.

@richvdh
Copy link
Member Author

richvdh commented Apr 23, 2024

(To use the rust cryptography stack, assuming you are on a recent version of Element, log out and in again.)

@richvdh richvdh added the Z-Awaiting-Element-R Issues in code which will be replaced by the port of Element's crypto layer to Rust label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Awaiting-Element-R Issues in code which will be replaced by the port of Element's crypto layer to Rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants