You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
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
This commit is contained in:
@@ -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 ` +
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user