Skip to content

Commit 8def00c

Browse files
Gnuxieesoteric_programmer
andauthored
fix spurious error log line regarding room takedowns when the room ha… (#995)
* 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 <[email protected]>
1 parent 0c448ab commit 8def00c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/protections/RoomTakedown/RoomTakedown.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
Recommendation,
1515
} from "matrix-protection-suite";
1616
import { RoomAuditLog } from "./RoomAuditLog";
17-
import { isError, Ok, Result, ResultError } from "@gnuxie/typescript-result";
17+
import { isError, Ok, Result } from "@gnuxie/typescript-result";
1818
import { RoomTakedownCapability } from "../../capabilities/RoomTakedownCapability";
1919

2020
const log = new Logger("RoomTakedown");
@@ -58,9 +58,10 @@ export class StandardRoomTakedown implements RoomTakedownService {
5858
return isRoomTakendownResult;
5959
}
6060
if (isRoomTakendownResult.ok) {
61-
return ResultError.Result(
62-
`The room ${roomID} has already been takendown according to your homeserver`
61+
log.debug(
62+
`The room ${roomID} has already been taken down according to your homeserver`
6363
);
64+
return Ok(undefined);
6465
}
6566
const detailsResult = await this.takedownCapability.getRoomDetails(roomID);
6667
const takedownResult = await this.takedownCapability.takedownRoom(roomID);

0 commit comments

Comments
 (0)