element-hq / element-hq/element-web

Web doesn't share Megolm sessions after refreshing

Open
#18,560 2 comments 0 reactions 0 assignees View on GitHub
A-E2EE O-Uncommon S-Major T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Disclaimer

I'm still somewhat trying to figure out how all the encryption pieces work so may have misdiagnosed this - please be cautious and feel free to tell me I'm wrong 😅

### Steps to reproduce

As a prerequisite: you'll need some sort of thin client/bot to easily see this. In my case, that's a bot-sdk example bot which is trying to respond to a `!ping` command. At the time of writing, the bot knows nothing about keyshare requests so is expecting the `m.room_key` to be sent to it.

1. In an encrypted room, send a message from Element
2. In the thin client, verify that the event was decrypted successfully
3. Refresh Element (ensuring it had time to persist the room to avoid other bugs about "server changed encryption config")
4. In the same encrypted room, send another message from Element
5. Verify that the thin client can't decrypt the message (without keyshare requests)

As additional checks, during 2 and 5 check the session IDs used by Element and monitor for to-device traffic in the network logs. The first message should have outbound to-device traffic while the second message will be a (needlessly) new session ID without any to-device messages going out.

### What happened?

The message failed to decrypt in a client which did not support/understand keysharing.

### What did you expect?

The message should have been decrypted. Specifically, the keys for the new session should have been sent.

### Operating system

Windows 10

### Browser information

Edge 92.0.902.67 (Official build) (64-bit)

### URL for webapp

local build of develop.element.io

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.