mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 07:27:45 -04:00
The SQLite crypto store uses rmp_serde to serialize all the data we're going to store. This works nicely for most things, one exception to this is the OutboundGroupSession type. The OutboundGroupSession type stores to-device requests to ensure that the session doesn't get used before it is shared with the whole group and to ensure that the to-device requests get restored if the session gets restored after an application restart. The to-device requests type critically contain `Raw<AnyToDeviceEvent>`, the `Raw` type here being the serde_json::Raw type. rmp_serde seems to serialize this just fine, but later deserialization fails. We're avoiding the issue by using serde_json to serialize the OutboundGroupSession.