element-meta icon indicating copy to clipboard operation
element-meta copied to clipboard

Epic: Failing to import keys from key backups cause UTDs

Open kegsay opened this issue 11 months ago • 2 comments

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.

kegsay avatar Mar 13 '24 14:03 kegsay

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

richvdh avatar Mar 13 '24 15:03 richvdh

@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

BillCarsonFr avatar Mar 19 '24 15:03 BillCarsonFr

Causes of this are fixed.

richvdh avatar May 29 '24 08:05 richvdh