matrix-rust-sdk
matrix-rust-sdk copied to clipboard
Multiple Olm Session: should use the session from which it last 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. For these purposes, a session that has not received any messages should use its creation time as the time that it last received a message.
But currently, olm sessions are only ordered by creation_time; https://github.com/matrix-org/matrix-rust-sdk/blob/75fe874cae8424ec09a869b62ed6719115eaa91a/crates/matrix-sdk-crypto/src/identities/device.rs#L643-L651