Skip to main content

Room Cleanup

Room cleanup

After each provisioning cycle, Group Sync 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, Group Sync 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 Group Sync manages. This can happen in a few cases:

  1. The room belonged to a space that was cleaned up up by Group Sync
  2. The room has been removed from a space managed by Group Sync
  3. The room is made private (but remains in a managed space)

Notably, none of these apply if a default rooms gets deconfigured in Group Sync. 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 Group Sync, 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 Group Sync, its power levels are not touched. Group Sync 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.