From cb69515be9c0a044ae43821cdf597db7c492b660 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 20 Feb 2020 14:49:32 -0500 Subject: [PATCH] add some logging when sender could not establish an olm session --- src/crypto/algorithms/megolm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crypto/algorithms/megolm.js b/src/crypto/algorithms/megolm.js index 039f1f2cd..8c9ef81f0 100644 --- a/src/crypto/algorithms/megolm.js +++ b/src/crypto/algorithms/megolm.js @@ -1241,6 +1241,9 @@ MegolmDecryption.prototype.onRoomKeyWithheldEvent = async function(event) { if (content.code === "m.no_olm") { const sender = event.getSender(); + logger.warn( + `${sender}:${senderKey} was unable to establish an olm session with us`, + ); // if the sender says that they haven't been able to establish an olm // session, let's proactively establish one @@ -1252,6 +1255,7 @@ MegolmDecryption.prototype.onRoomKeyWithheldEvent = async function(event) { if (await this._olmDevice.getSessionIdForDevice(senderKey)) { // a session has already been established, so we don't need to // create a new one. + logger.debug("New session already created. Not creating a new one."); await this._olmDevice.recordSessionProblem(senderKey, "no_olm", true); this.retryDecryptionFromSender(senderKey); return;