From ab69eab8a492e99d7e30f4e3196c5a6d09debe0b Mon Sep 17 00:00:00 2001 From: Elliu Date: Sat, 1 Nov 2025 21:01:15 +0900 Subject: [PATCH] Fix tests for new link space error message --- src/web/routes/link.js | 4 ++-- src/web/routes/link.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/routes/link.js b/src/web/routes/link.js index a7ae8ec..d4d13da 100644 --- a/src/web/routes/link.js +++ b/src/web/routes/link.js @@ -76,13 +76,13 @@ as.router.post("/api/link-space", defineEventHandler(async event => { if (existing) throw createError({status: 400, message: "Bad Request", data: `Guild ID ${guildID} or space ID ${spaceID} are already bridged and cannot be reused`}) const inviteSender = select("invite", "mxid", {mxid: session.data.mxid, room_id: spaceID}).pluck().get() - const via = [ inviteSender?.match(/:(.*)/)?.[1] ?? "" ] + const via = [ inviteSender?.match(/:(.*)/)?.[1] ?? "" ] // Check space exists and bridge is joined try { await api.joinRoom(parsedBody.space_id, null, via) } catch (e) { - throw createError({status: 400, message: "Unable To Join", data: `Unable to join the requested Matrix space. Please invite the bridge to the space and try again. (Server said: ${e.errcode} - ${e.message})`}) + throw createError({status: 400, message: "Unable To Join", data: `Unable to join the requested Matrix space. Please invite the bridge to the space and try again. (Server said: ${e.errcode} - ${e.message})`}) } // Check bridge has PL 100 diff --git a/src/web/routes/link.test.js b/src/web/routes/link.test.js index 068bc9b..ffe4e5e 100644 --- a/src/web/routes/link.test.js +++ b/src/web/routes/link.test.js @@ -77,7 +77,7 @@ test("web link space: check that OOYE is joined", async t => { } } })) - t.equal(error.data, "M_FORBIDDEN - not allowed to join I guess") + t.equal(error.data, "Unable to join the requested Matrix space. Please invite the bridge to the space and try again. (Server said: M_FORBIDDEN - not allowed to join I guess)") t.equal(called, 1) })