diff --git a/changelog.d/342.bugfix b/changelog.d/342.bugfix new file mode 100644 index 00000000..d7284471 --- /dev/null +++ b/changelog.d/342.bugfix @@ -0,0 +1 @@ +Leave the new room on room upgrade if the upgrade was not successful. \ No newline at end of file diff --git a/src/components/room-upgrade-handler.ts b/src/components/room-upgrade-handler.ts index 7f62ca71..104f5830 100644 --- a/src/components/room-upgrade-handler.ts +++ b/src/components/room-upgrade-handler.ts @@ -150,6 +150,7 @@ export class RoomUpgradeHandler { log.error( `Room doesn't have a matching predecessor (expected: ${oldRoomId}, got: ${predecessor.room_id}), not bridging.` ); + await intent.leave(newRoomId); return false; } const asBot = this.bridge.getBot(); @@ -157,6 +158,7 @@ export class RoomUpgradeHandler { const success = await this.migrateStoreEntries(oldRoomId, newRoomId); if (!success) { log.error("Failed to migrate room entries. Not continuing with migration."); + await intent.leave(newRoomId); return false; } }