element-hq / element-hq/element-ios

Error shown on every message sent in some channels: "MatrixSDKCrypto.DecryptionError("error: invalid value: floating point `1.8446744073709552e19`, expected a number between 0 and 2^53 - 1 at line 1 column 40")

Open
#7,902 4 comments 2 reactions 0 assignees View on GitHub
T-Defect
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

On sending messages, one particular user (not me) in a few specific channels gets a message:

"MatrixSDKCrypto.DecryptionError("error: invalid value: floating point `1.8446744073709552e19`, expected a number between 0 and 2^53 - 1 at line 1 column 40")

- The messages are received properly by other participants in the room.
- This happens in a few (related) private rooms on matrix.org. Below info is gathered from the !hppPCMMaCzIbIgRgLC:matrix.org room.
- This does not happen in a newly created room with just me and the other user.
- The user has ios phone and a second device (tablet, unsure what Element version) and has done the verification flow with these devices, but the phone still shows cross signing is not set up in the settings.
- The user gets this message on their phone, not sure if the tablet also shows the problem.
- The user has not tried reinstalling yet (partly in fear of losing history, partly on my request to allow collecting info for this report).

Here's a screenshot of a particular problematic message:

![Image](https://github.com/user-attachments/assets/0abf4c21-e572-4c87-85c0-9309a5ace230)

Using Element web for another user in the same room, I collected the event sources:

Decrypted event source
```
{
"content": {
"body": "Test",
"msgtype": "m.text"
},
"event_id": "$LNXJEymxivBQHeFsJLFJTjQBBHnRJzMS6692W4J29Bc",
"origin_server_ts": 1739104120581,
"room_id": "!hppPCMMaCzIbIgRgLC:matrix.org",
"sender": "@nicoles:matrix.org",
"type": "m.room.message",
"unsigned": {}
}
```

Original event source
```
{
"content": {
"algorithm": "m.megolm.v1.aes-sha2",
"ciphertext": "AwgBEoABSDxzVEJmKFGX+RokVPKQRUCRbO6dLHdoQqJV1fC1aKqydIZe90mckbCU5zk+HBxxZ61/IjJe481WIZ8bGPIkrWmiW0XTT66Xlbb6vBw2ac6P8QkxQgWbxSzP2gGzdtVK1BLKkdo/0Y/vao8luE95mKxC4lPaT7eM6UIZCM6VFjJMTDObUtY0i/YzBbk+DjCcBVa542RoKrtT21fcP6M7Z7vVPEz/qZz9BrC8xtyje2Nx2hHqkhezcQGAKWj5JXrRLHFYnJVkWgQ",
"device_id": "SHLMNQUZKB",
"sender_key": "x73CWZ+0F35mmy1bGVCeB7yTBHKdtJq5zvJmvGfDG2Y",
"session_id": "t98+DR4F6AXyF9pufUMAsZUOPkUkXA++kMzeOCNj6cY"
},
"origin_server_ts": 1739104120581,
"sender": "@nicoles:matrix.org",
"type": "m.room.encrypted",
"unsigned": {
"membership": "join",
"age": 341
},
"event_id": "$LNXJEymxivBQHeFsJLFJTjQBBHnRJzMS6692W4J29Bc",
"room_id": "!hppPCMMaCzIbIgRgLC:matrix.org"
}
```

Using /devtools, I found the `m.room.encryption` room state:

```
{
"content": {
"algorithm": "m.megolm.v1.aes-sha2"
},
"origin_server_ts": 1726146090473,
"sender": "@giplt:matrix.org",
"state_key": "",
"type": "m.room.encryption",
"unsigned": {
"age": 12867200095
},
"event_id": "$6FpFHBwmMRe2S8X0TBSJZAdV_s6SZZ4JM5KvzHD-Wbs",
"room_id": "!hppPCMMaCzIbIgRgLC:matrix.org"
}
```

Given the message is an exception and not a proper error message, I suspect this might be a bug in the ios client, maybe combined with something weird in the room state/timeline.

I hope this is enough info to diagnose the issue, since collecting info is a bit tricky (I am doing this remotely without direct access to their phone).

I asked the user to report an issue (with a very brief description) via the app and include logs, in the expectation that that would show up as an issue in this repo or elsewhere and I could add the above details in a comment, but I could not find the issue anywhere. If anyone here can look through such reports and copy the logs here, that would be great. The report was made on 2025-02-09, around 14:30 UTC.

### Outcome

See above

### Your phone model

_No response_

### Operating system version

_No response_

### Application version

_No response_

### Homeserver

matrix.org

### Will you send logs?

Yes

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.