From 78c3157a5f9d295632e82381d893321c57f3afcf Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 31 Aug 2020 16:05:57 +0200 Subject: [PATCH] fix not taking into account Object.entries yields arrays for the pairs --- src/matrix/e2ee/DeviceTracker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/matrix/e2ee/DeviceTracker.js b/src/matrix/e2ee/DeviceTracker.js index 50b9f5e8..41e9d231 100644 --- a/src/matrix/e2ee/DeviceTracker.js +++ b/src/matrix/e2ee/DeviceTracker.js @@ -186,8 +186,8 @@ export class DeviceTracker { } _filterVerifiedDeviceKeys(keyQueryDeviceKeysResponse) { - const verifiedKeys = Object.entries(keyQueryDeviceKeysResponse).map((userId, keysByDevice) => { - const verifiedKeys = Object.entries(keysByDevice).filter((deviceId, deviceKeys) => { + const verifiedKeys = Object.entries(keyQueryDeviceKeysResponse).map(([userId, keysByDevice]) => { + const verifiedEntries = Object.entries(keysByDevice).filter(([deviceId, deviceKeys]) => { const deviceIdOnKeys = deviceKeys["device_id"]; const userIdOnKeys = deviceKeys["user_id"]; if (userIdOnKeys !== userId) { @@ -198,6 +198,7 @@ export class DeviceTracker { } return this._verifyUserDeviceKeys(deviceKeys); }); + const verifiedKeys = verifiedEntries.map(([, deviceKeys]) => deviceKeys); return {userId, verifiedKeys}; }); return verifiedKeys;