Skip to content

Commit 36758cd

Browse files
committed
Stop Mjolnir blindly protecting all policy lists at startup. (#431)
`Mjolnir.resyncAllJoinedRooms` needs policy lists to be loaded into mjolnir in order to filter them out of the protect rooms set (unless explicitly protected). This is so that you don't end up having mjolnir complain about protecting a list which you have no control over, and are just watching (e.g. #matrix-org-coc-bl:matrix.org).
1 parent 625ef72 commit 36758cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Mjolnir.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,10 @@ export class Mjolnir {
291291
await this.protectedRoomsConfig.loadProtectedRoomsFromConfig(this.config);
292292
await this.protectedRoomsConfig.loadProtectedRoomsFromAccountData();
293293
this.protectedRoomsConfig.getExplicitlyProtectedRooms().forEach(this.protectRoom, this);
294-
await this.resyncJoinedRooms(false);
294+
// We have to build the policy lists before calling `resyncJoinedRooms` otherwise mjolnir will try to protect
295+
// every policy list we are already joined to, as mjolnir will not be able to distinguish them from normal rooms.
295296
await this.buildWatchedPolicyLists();
297+
await this.resyncJoinedRooms(false);
296298
await this.protectionManager.start();
297299

298300
if (this.config.verifyPermissionsOnStartup) {

0 commit comments

Comments
 (0)