From 7a9784fd6ef39e4fc214e8416456b9d92cb9f7e8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 5 Jun 2017 17:26:25 +0100 Subject: [PATCH] KeyRequestHandler: clear redundant users/devices on cancellations ... otherwise _processNextRequest will get confused --- src/KeyRequestHandler.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/KeyRequestHandler.js b/src/KeyRequestHandler.js index fbb869d468..4354fba269 100644 --- a/src/KeyRequestHandler.js +++ b/src/KeyRequestHandler.js @@ -88,6 +88,12 @@ export default class KeyRequestHandler { } console.log("Forgetting room key request"); requests.splice(idx, 1); + if (requests.length === 0) { + delete this._pendingKeyRequests[userId][deviceId]; + if (Object.keys(this._pendingKeyRequests[userId]).length === 0) { + delete this._pendingKeyRequests[userId]; + } + } } _processNextRequest() {