From facad90cdcc99cf91bf08e571feec5c3460b6d8e Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 9 Oct 2024 08:17:01 -0600 Subject: [PATCH] reset should not happen before room has keyID set --- apps/meteor/app/e2e/client/rocketchat.e2e.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/meteor/app/e2e/client/rocketchat.e2e.ts b/apps/meteor/app/e2e/client/rocketchat.e2e.ts index 985d055bbb45..fa1cda643902 100644 --- a/apps/meteor/app/e2e/client/rocketchat.e2e.ts +++ b/apps/meteor/app/e2e/client/rocketchat.e2e.ts @@ -271,7 +271,11 @@ class E2E extends Emitter { } // When the key was already set and is changed via an update, we update the room instance - if (this.instancesByRoomId[rid].keyID !== undefined && this.instancesByRoomId[rid].keyID !== room.e2eKeyId) { + if ( + this.instancesByRoomId[rid].keyID !== undefined && + room.e2eKeyId !== undefined && + this.instancesByRoomId[rid].keyID !== room.e2eKeyId + ) { // KeyID was changed, update instance with new keyID and put room in waiting keys status this.instancesByRoomId[rid].onRoomKeyReset(room.e2eKeyId); }