diff --git a/src/createRoom.js b/src/createRoom.js index a39d2c2216..4d59b11656 100644 --- a/src/createRoom.js +++ b/src/createRoom.js @@ -212,7 +212,17 @@ export async function _waitForMember(client, roomId, userId, opts = { timeout: 1 * can encrypt to. */ export async function canEncryptToAllUsers(client, userIds) { - const usersDeviceMap = await client.downloadKeys(userIds); + let usersDeviceMap; + try { + usersDeviceMap = await client.downloadKeys(userIds); + } catch (ex) { + if (ex.httpStatus === 404) { + // The endpoint to fetch keys doesn't exist: force unencrypted. + // See: https://github.com/vector-im/riot-web/issues/13598 + return false; + } + throw ex; + } // { "@user:host": { "DEVICE": {...}, ... }, ... } return Object.values(usersDeviceMap).every((userDevices) => // { "DEVICE": {...}, ... }