From d9f070404830059d2ef75497995b163be45ecf46 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 20 Mar 2022 20:10:45 +0000 Subject: [PATCH] reduce flakiness of e2e verif test it's completely valid to receive a `ready` event after having received a `start` event as messages may be received or decrypted in any order. partial (but possibly sufficient?) fix for https://github.com/vector-im/element-web/issues/21488 --- src/crypto/verification/request/VerificationRequest.ts | 6 +++--- src/webrtc/callEventHandler.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto/verification/request/VerificationRequest.ts b/src/crypto/verification/request/VerificationRequest.ts index 49256b0b1..f250d7df5 100644 --- a/src/crypto/verification/request/VerificationRequest.ts +++ b/src/crypto/verification/request/VerificationRequest.ts @@ -842,11 +842,11 @@ export class VerificationRequest< } const isUnexpectedRequest = type === REQUEST_TYPE && this.phase !== PHASE_UNSENT; - const isUnexpectedReady = type === READY_TYPE && this.phase !== PHASE_REQUESTED; + const isUnexpectedReady = type === READY_TYPE && this.phase !== PHASE_REQUESTED && this.phase !== PHASE_STARTED; // only if phase has passed from PHASE_UNSENT should we cancel, because events // are allowed to come in in any order (at least with InRoomChannel). So we only know - // we're dealing with a valid request we should participate in once we've moved to PHASE_REQUESTED - // before that, we could be looking at somebody elses verification request and we just + // we're dealing with a valid request we should participate in once we've moved to PHASE_REQUESTED. + // Before that, we could be looking at somebody else's verification request and we just // happen to be in the room if (this.phase !== PHASE_UNSENT && (isUnexpectedRequest || isUnexpectedReady)) { logger.warn(`Cancelling, unexpected ${type} verification ` + diff --git a/src/webrtc/callEventHandler.ts b/src/webrtc/callEventHandler.ts index f190bde60..9053f8f41 100644 --- a/src/webrtc/callEventHandler.ts +++ b/src/webrtc/callEventHandler.ts @@ -279,7 +279,7 @@ export class CallEventHandler { // The following events need a call and a peer connection if (!call || !call.hasPeerConnection) { - logger.warn("Discarding an event, we don't have a call/peerConn", type); + logger.info(`Discarding possible call event ${event.getId()} as we don't have a call/peerConn`, type); return; } // Ignore remote echo