Room Cleanup
Room cleanup
After each provisioning cycle, Advanced Identity Management will clean up the rooms and spaces that it no longer needs to manage. Spaces in Matrix are still rooms, but we treat them a little differently during the cleanup, matching their distinct uses.
Internally, room cleanup is refered to as Room GC (Garbage Collection).
This is meant to be a reversible process (in case it was performed accidentally), so we avoid information loss when possible.
Space cleanup
Spaces are cleaned up when they are no longer configured -- once they are removed from Space mapping configuration, Advanced Identity Management will abandon them by kicking every member and then leaving itself
- resulting in an empty room that will eventually get cleanup up entirely by the homeserver.
The kicking of the users is done so that the deconfigured spaces don't show up in their clients anymore. The rooms inside those spaces remain accessible though, so no conversations are being lost.
We don't draw a distinction here between GS- and user-created spaces, because GS doesn't care about user-created spaces at all. It never joins them and it never manages them, so they will never be part of the cleanup process.
Room cleanup
Rooms are cleaned up when they're no longer accessible from any of the spaces that Advanced Identity Management manages. This can happen in a few cases:
- The room belonged to a space that was cleaned up up by Advanced Identity Management
- The room has been removed from a space managed by Advanced Identity Management
- The room is made private (but remains in a managed space)
Notably, none of these apply if a default rooms gets deconfigured in Advanced Identity Management. Those get created in each GS-managed space, but after their creation they're treated like any other space-public[^note] room.
When a room is cleaned up, GS cleans up its room metadata (this is stored in state events) and leaves the room. All the room members remain in the room so that the conversation is preserved and can continue if needed. Room moderators can then tombstone the room if they so desire, or add it to a different space.
If the room was not originally created by Advanced Identity Management, we give PL 100 back to its original creator (having taken it away back when we took control of it). If a room was created by Advanced Identity Management, its power levels are not touched. Advanced Identity Management remains a room admin in case it needs to take control of the room again in the future (e.g. because it gets added to a different managed space).
[^note]: Space-public meaning: with join_rule: restricted
, allowing space members to join.
Configuration
Room and Space cleanup can be configured through :
provisioner:
# Optional. When enabled, spaces that are no longer configured, and rooms belonging to those spaces will be cleaned up.
# This will likely become enabled by default in the future.
# When disabled (or omitted), GS will log the rooms and spaces it would clean up if allowed to.
gc:
enabled: true