element-hq / element-hq/element-android

Sending offline message breaks encryption

Open
#8,245 14 comments 12 reactions 0 assignees View on GitHub
A-E2EE T-Defect X-Needs-Rust
Dominant language
Kotlin
Stars
3.7k
Forks
917
Avg merge
8d 20h
Merged PRs (30d)
1

Description

Since several months I've experienced problems that recipients couldn't decrypt my messages from time to time. After talking to some other matrix server administrators we could reproduce that this happens whenever the sending device has no online connection while sending a message. This can happen on mobile devices like smartphones, tablets and notebooks in dead zones or with weak wifi hotspot signals (in my case: "hotspot hopping" from subway station to subway station).

### Steps to reproduce

1. Go offline with a mobile device (can be element-desktop on a notebook as well).
2. Send a message in an encrypted room.
3. Go online with the mobile device.
4. Recepients get `Unable to decrypt message` (desktop client) or `Waiting for this message, this may take a while` (mobile client).

Current workaround: Sender has to execute `/discardsession` and resend the messages. This workaround is very disturbing for non-technical users.

Ideas:
* The client shouold not let users send messages if there is no working online connection or
* let them send messages in the way that these messages will be send when the device goes online, meanwhile the messages are tagged as "this message will be send when your device goes online again".

### Outcome

#### What did you expect?

I expect that messages I write offline are send properly when I go online.

#### What happened instead?

I see my messages are properly sended by the recipients get `Unable to decrypt message` (desktop client) or `Waiting for this message, this may take a while` (mobile client) messages instead.

### Your phone model

(several)

### Operating system version

(several, experienced under Android, iOS and Linux)

### Application version and app store

(several, experienced under Android, iOS and Linux)

### Homeserver

(happens on my own server and during federated communication)

### Will you send logs?

Yes

### Are you willing to provide a PR?

No

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.