From 6f579f03d3b7b4994227fff437cbf946b571f68b Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 2 May 2023 10:26:42 +0100 Subject: [PATCH 1/3] Create a new ping room if the previous room cannot be reached --- src/Main.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Main.ts b/src/Main.ts index 4a3030af..751761e7 100644 --- a/src/Main.ts +++ b/src/Main.ts @@ -1707,12 +1707,23 @@ export class Main { private async pingBridge() { let internalRoom: string|null; + const intent = this.bridge.getIntent(); try { internalRoom = await this.datastore.getUserAdminRoom("-internal-"); + if (internalRoom) { + try { + await intent.join(internalRoom); + } catch (ex) { + // Unable to join the room, probably broken. Create another. + internalRoom = null; + } + } + if (!internalRoom) { - internalRoom = (await this.bridge.getIntent().createRoom({ options: {}})).room_id; + internalRoom = (await intent.createRoom({ options: {}})).room_id; await this.datastore.setUserAdminRoom("-internal-", internalRoom); } + const time = await this.bridge.pingAppserviceRoute(internalRoom); log.info(`Successfully pinged the bridge. Round trip took ${time}ms`); } From c82f6b90fbc2a69070576c16e1e581a46c6132bb Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 2 May 2023 10:28:40 +0100 Subject: [PATCH 2/3] changelog --- changelog.d/752.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/752.bugfix diff --git a/changelog.d/752.bugfix b/changelog.d/752.bugfix new file mode 100644 index 00000000..9439dd97 --- /dev/null +++ b/changelog.d/752.bugfix @@ -0,0 +1 @@ +Fix a case where the bridge will fail to start if it cannot access it's internal ping room From d25f6f2b5ebba05c13d56ce01c27a481524088c0 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Tue, 2 May 2023 14:49:06 +0100 Subject: [PATCH 3/3] Update 752.bugfix --- changelog.d/752.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/752.bugfix b/changelog.d/752.bugfix index 9439dd97..674cb127 100644 --- a/changelog.d/752.bugfix +++ b/changelog.d/752.bugfix @@ -1 +1 @@ -Fix a case where the bridge will fail to start if it cannot access it's internal ping room +Fix a case where the bridge will fail to start if it cannot access it's internal ping room.