fix(crypto): trace where an incoming verification request stops

This commit is contained in:
Erwan Leboucher committed 2026-09-01 20:03:19 +02:00
1 parent a901553d6b
commit e47823002b
1 file changed
+17 -1
+17 -1
View File
@@ -733,6 +733,12 @@ export class EngineCrypto
}
const request = new EngineVerificationRequest(this.#engineCall, state);
this.#verificationRequests.set(transactionId, request);
engineCryptoLog.info('general', 'Surfacing an incoming verification request', {
sender,
transactionId,
isSelfVerification: state.isSelfVerification,
phase: state.phase,
});
this.emit(CryptoEvent.VerificationRequestReceived, request);
return true;
}
@@ -746,7 +752,12 @@ export class EngineCrypto
await this.#sendTracked(await this.#call('queryKeysForUsers', { users: [sender] }));
await this.#flushOutgoingRequests();
await this.#receiveSyncChanges({ toDeviceEvents: [event] });
await this.onIncomingKeyVerificationRequest(sender, transactionId);
if (!(await this.onIncomingKeyVerificationRequest(sender, transactionId))) {
engineCryptoLog.warn('general', 'The engine kept ignoring a verification request', {
sender,
transactionId,
});
}
}
#flushOutgoingRequests(): Promise<void> {
@@ -816,6 +827,11 @@ export class EngineCrypto
if (typeof message.type === 'string' && message.type.startsWith('m.key.verification.')) {
const transactionId = (message.content as { transaction_id?: string })?.transaction_id;
if (transactionId && message.sender) {
engineCryptoLog.info('general', 'Received a verification to-device event', {
type: message.type,
sender: message.sender,
transactionId,
});
if (message.type === EventType.KeyVerificationRequest) {
// eslint-disable-next-line no-await-in-loop
const handled = await this.onIncomingKeyVerificationRequest(