Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Sending your first message from a new device in a megolm room can take 10s of seconds #2157
reusing megolm sessions would mean also keeping track of who we had sent the session keys to, so it's not as quick a win as all that. In any case, it wouldn't do anything to reduce the number of Olm sessions we need to create, because we already reuse them across browser restarts.
For example, I just sent a message in #megolm, from a new browser instance (but an existing device, obviously). The time between me hitting enter, and making the "/send" request, was 1520ms, which was dominated by two round-trips to the server (one to download some keys (see #2275), and one to claim a bunch of one-time Olm keys). The longest frame was 312ms, when it was doing the encryption of the session key for each of the (120) devices in the room.
So, the problem here probably really only applies to the first message you send from a new device (as the title says); so reusing anything across browser restarts won't help us. When I tried that just now, it took about 10 seconds to send, which was dominated by two 5s js frames, which were verifying the Ed25519 signatures on the devices in the room, and creating Olm sessions for them, respectively.
Mitigation strategies probably include: