From 2cd4eb5e2c5583a153a9ad09aad16f52eb4ef3ab Mon Sep 17 00:00:00 2001 From: "h.carnot" Date: Thu, 24 Mar 2022 13:52:28 +0100 Subject: [PATCH] fix: remove pendaing outbound group session creation on completed or errored --- lib/encryption/key_manager.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/encryption/key_manager.dart b/lib/encryption/key_manager.dart index 5f9f6547..2e893b54 100644 --- a/lib/encryption/key_manager.dart +++ b/lib/encryption/key_manager.dart @@ -443,8 +443,11 @@ class KeyManager { } _pendingNewOutboundGroupSessions[roomId] = _createOutboundGroupSession(roomId); - await _pendingNewOutboundGroupSessions[roomId]; - return _pendingNewOutboundGroupSessions.remove(roomId)!; + try { + await _pendingNewOutboundGroupSessions[roomId]; + } finally { + return _pendingNewOutboundGroupSessions.remove(roomId)!; + } } /// Prepares an outbound group session for a given room ID. That is, load it from