From 8bc0ef8c27533a9e95ab33be1c4787cf134abdbc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 4 Feb 2020 12:44:17 +0100 Subject: [PATCH] add logging when a request is being cancelled so we can more easily see (especially for to_device requests) why something was cancelled --- src/crypto/verification/request/VerificationRequest.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index 57a3bbeeb..4f62c23ba 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -557,6 +557,15 @@ export class VerificationRequest extends EventEmitter { } else if (this._observeOnly !== wasObserveOnly) { this.emit("change"); } + + // log cancellations so we can see from rageshakes why riot sometimes cancels + // requests on its own + if (type === CANCEL_TYPE) { + logger.log(`verification request ${this.channel.transactionId}: ` + + `.cancel event with ${JSON.stringify(event.getContent())} ` + + `sender=${event.getSender()}, isSentByUs=${isSentByUs} ` + + `phase=${this.phase}`); + } } _setupTimeout(phase) {