matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Olm Session: Set last_use_time when received and successfully decrypted a message

Open BillCarsonFr opened this issue 7 months ago • 0 comments

As per spec:

If a client has multiple sessions established with another device, it should use the session from which it last received and successfully decrypted a message.

Currently the sdk has a last_use_time but it is both updated when;

  • a message is succesfully received and decrypted
  • a message is succesfully encrypted https://github.com/matrix-org/matrix-rust-sdk/blob/75fe874cae8424ec09a869b62ed6719115eaa91a/crates/matrix-sdk-crypto/src/olm/session.rs#L127-L134

=> Should be udpdated only on reception, and then used for ordering (see #2970)

BillCarsonFr avatar Dec 22 '23 08:12 BillCarsonFr