-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework joined room tracking in Mjolnir. #370
Comments
So, what I'm thinking is that We then also don't have a horrible set of conflicting room tracking utils in the Mjolnir class as all this can be moved to |
The combination of `resyncJoinedRooms`, `unprotectedWatchedListRooms`, `explicitlyProtectedRoomIds`, `protectedJoinedRoomIds` was incomprehensible. #370 Separating out the management of `explicitlyProtectedRoomIds`, then making sure all policy lists have to be explicitly protected (in either setting of `config.protectAllJoinedRooms`) will make this code much much simpler. We will later change the `status` command to explicitly show which lists are watched and which are watched and protected.
The combination of `resyncJoinedRooms`, `unprotectedWatchedListRooms`, `explicitlyProtectedRoomIds`, `protectedJoinedRoomIds` was incomprehensible. #370 Separating out the management of `explicitlyProtectedRoomIds`, then making sure all policy lists have to be explicitly protected (in either setting of `config.protectAllJoinedRooms`) will make this code much much simpler. We will later change the `status` command to explicitly show which lists are watched and which are watched and protected.
The combination of `resyncJoinedRooms`, `unprotectedWatchedListRooms`, `explicitlyProtectedRoomIds`, `protectedJoinedRoomIds` was incomprehensible. #370 Separating out the management of `explicitlyProtectedRoomIds`, then making sure all policy lists have to be explicitly protected (in either setting of `config.protectAllJoinedRooms`) will make this code much much simpler. We will later change the `status` command to explicitly show which lists are watched and which are watched and protected.
The combination of `resyncJoinedRooms`, `unprotectedWatchedListRooms`, `explicitlyProtectedRoomIds`, `protectedJoinedRoomIds` was incomprehensible. #370 Separating out the management of `explicitlyProtectedRoomIds`, then making sure all policy lists have to be explicitly protected (in either setting of `config.protectAllJoinedRooms`) will make this code much much simpler. We will later change the `status` command to explicitly show which lists are watched and which are watched and protected.
The combination of `resyncJoinedRooms`, `unprotectedWatchedListRooms`, `explicitlyProtectedRoomIds`, `protectedJoinedRoomIds` was incomprehensible. #370 Separating out the management of `explicitlyProtectedRoomIds`, then making sure all policy lists have to be explicitly protected (in either setting of `config.protectAllJoinedRooms`) will make this code much much simpler. We will later change the `status` command to explicitly show which lists are watched and which are watched and protected.
The tracking of joined rooms is barely comprehensible at the moment.
This is complicated by the need to track and protect all joined rooms (except those which we can't such as policy lists we are watching but don't moderate).
mjolnir/src/Mjolnir.ts
Lines 474 to 503 in 4d5447c
mjolnir/src/Mjolnir.ts
Lines 748 to 753 in 4d5447c
mjolnir/src/Mjolnir.ts
Lines 97 to 102 in 4d5447c
PROTECTED_ROOMS_EVENT_TYPE
is difficult to track.What are all these things doing?
protectAllJoinedRooms
isfalse
:PROTECTED_ROOMS_EVENT_TYPE
Persisting the set of rooms Mjolnir protects for when it next starts up.protectAllJoinedRooms
istrue
: working out which rooms are protected from all joined rooms based on whether they are a watched list and it is determined (arbitrarily) that we don't moderate the list. There might be other reasons not to protect a room.protectAllJoinedRooms
istrue
: Working out when we have joined a room so it can also be protected.What needs to change then?
While #371 will factor out protected rooms from the Mjolnir class, it will not change the tracking of joined rooms. It intentionally does not try to synchronize
PROTECTED_ROOMS_EVENT_TYPE
either. This is because it would contaminateProtectedRooms
which is supposed to be able to work in isolation of Mjolnir and we shouldn't be tied to one group of protected rooms (See #283).protectAllJoinedRooms
from everything else (ie working out new joins, working out from joins which rooms we are currently protecting) like protected rooms. Currently they contaminate each other even when it's not used and it's what makes things horrible.Related:
The text was updated successfully, but these errors were encountered: