From 8def00c2ed0a589be43ce9d381b6b366a8e0de8f Mon Sep 17 00:00:00 2001 From: Gnuxie <50846879+Gnuxie@users.noreply.github.com> Date: Fri, 7 Nov 2025 12:28:28 +0000 Subject: [PATCH] =?UTF-8?q?fix=20spurious=20error=20log=20line=20regarding?= =?UTF-8?q?=20room=20takedowns=20when=20the=20room=20ha=E2=80=A6=20(#995)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix spurious error log line regarding room takedowns when the room has already been taken down. This is normal, and while generally the bot shouldn't attempt to take down the same rooms which succeeded in the past, there's no way of knowing that the room hasn't been unblocked by the synapse admin API while draupnir was offline. Because there's no endpoint to get only the blocked rooms, we have to attempt to block them all again, but what we can do is lower that from critical severity to debug, since it's not actually a fatal error at all. * prettier --------- Co-authored-by: esoteric_programmer --- src/protections/RoomTakedown/RoomTakedown.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/protections/RoomTakedown/RoomTakedown.ts b/src/protections/RoomTakedown/RoomTakedown.ts index b7312c4f..97e7b016 100644 --- a/src/protections/RoomTakedown/RoomTakedown.ts +++ b/src/protections/RoomTakedown/RoomTakedown.ts @@ -14,7 +14,7 @@ import { Recommendation, } from "matrix-protection-suite"; import { RoomAuditLog } from "./RoomAuditLog"; -import { isError, Ok, Result, ResultError } from "@gnuxie/typescript-result"; +import { isError, Ok, Result } from "@gnuxie/typescript-result"; import { RoomTakedownCapability } from "../../capabilities/RoomTakedownCapability"; const log = new Logger("RoomTakedown"); @@ -58,9 +58,10 @@ export class StandardRoomTakedown implements RoomTakedownService { return isRoomTakendownResult; } if (isRoomTakendownResult.ok) { - return ResultError.Result( - `The room ${roomID} has already been takendown according to your homeserver` + log.debug( + `The room ${roomID} has already been taken down according to your homeserver` ); + return Ok(undefined); } const detailsResult = await this.takedownCapability.getRoomDetails(roomID); const takedownResult = await this.takedownCapability.takedownRoom(roomID);