matrix-js-sdk
60c9c403 - Improve setRoomEncryption guard against multiple m.room.encryption state events

Commit
7 years ago
Improve setRoomEncryption guard against multiple m.room.encryption state events we were only bailing out when receiving a non JSON-identical m.room.encryption event. When receiving an identical event, the algorithm in _roomEncryptors would be reset, generating a new megolm session every time this happens (there is a LL synapse bug where this happens on every sync). As the _roomList is backed by indexeddb you might already have a config without the algorithm being present though, so we first check for the room encryptor algorithm being present. If so, always bail out as setRoomEncryption was already called for the given room. If no algorithm is present, still check if the config is not being changed. Also setup the roomlist and room encryption synchronously before awaiting the indexeddb operation to store the room encryption config in roomlist.
Author
Committer
Parents
Loading