element-meta
element-meta copied to clipboard
Epic: Failing to import keys from key backups cause UTDs
As part of our work on UTDs it has become apparent that one source of UTDs is around historical messages before the client logged in. In this scenario, the sender will not encrypt for the target device, which is to be expected. If key backup is enabled and the user has >1 client, the newly logged in client should still be able to read the message because another client has decrypted and uploaded the key.
There is evidence this is not working as intended:
- Padding errors: https://github.com/element-hq/element-meta/issues/2338
- Imported 0 keys: https://github.com/matrix-org/matrix-rust-sdk/issues/3197
- Failed to deserialise response JSON: https://github.com/matrix-org/matrix-rust-sdk/issues/3211
- https://github.com/matrix-org/matrix-rust-sdk/issues/3247
All these cases will cause UTDs which are visible to the end-user. The above rageshakes were from Matthew and Patrick A as well as community members.
Separately to this, there is a class of expected UTDs which can occur which we currently do not have good support for. Consider:
- I am logged into my laptop with key backup enabled.
- I shut my laptop for the weekend.
- Messages are sent to me on Saturday.
- I login to my account on EX Android on Sunday.
- I get key backup configured.
- I see UTDs for historical messages, because the only client that can decrypt those messages is my laptop, which hasn't been opened since Friday.
- I will see UTDs until I open my laptop and have it upload the keys.
We need to figure out a solution for this failure mode, whether it is hiding the events as "expected UTDs" or otherwise.
Definition of done:
- [ ] Fix https://github.com/element-hq/element-meta/issues/2338
- [ ] Fix https://github.com/matrix-org/matrix-rust-sdk/issues/3197
- [ ] Fix https://github.com/matrix-org/matrix-rust-sdk/issues/3211
- [x] Fix https://github.com/matrix-org/matrix-rust-sdk/issues/3247
- [ ] Determine a solution to https://github.com/element-hq/element-meta/issues/2327 and implement it.
Separately to this, there is a class of expected UTDs which can occur which we currently do not have good support for....
This is https://github.com/element-hq/element-meta/issues/2327, I believe
@kegsay found another source https://github.com/matrix-org/matrix-rust-sdk/issues/3247 might be similar to https://github.com/matrix-org/matrix-rust-sdk/issues/3197 but can't confirm yet
Causes of this are fixed.