matrix-rust-sdk
matrix-rust-sdk copied to clipboard
Olm Session: Set last_use_time when received and successfully decrypted a message
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)