fix: Wait for keys in pusher

This commit is contained in:
Christian Pauly 2022-04-14 19:44:19 +02:00
parent 6d9d1a3bd7
commit b7e0d10b5a
1 changed files with 6 additions and 4 deletions

View File

@ -1088,11 +1088,13 @@ class Client extends MatrixApi {
final encryption = this.encryption; final encryption = this.encryption;
if (event.type == EventTypes.Encrypted && encryption != null) { if (event.type == EventTypes.Encrypted && encryption != null) {
event = await encryption.decryptRoomEvent(roomId, event); var decrypted = await encryption.decryptRoomEvent(roomId, event);
if (event.type == EventTypes.Encrypted && _currentSync != null) { if (decrypted.messageType == MessageTypes.BadEncrypted &&
await _currentSync; prevBatch != null) {
event = await encryption.decryptRoomEvent(roomId, event); await oneShotSync();
decrypted = await encryption.decryptRoomEvent(roomId, event);
} }
event = decrypted;
} }
if (storeInDatabase) { if (storeInDatabase) {