diff --git a/changelog.d/6816.misc b/changelog.d/6816.misc new file mode 100644 index 0000000000000000000000000000000000000000..a77ba1d7a5cad0b25e2368e3e3994af9db192561 --- /dev/null +++ b/changelog.d/6816.misc @@ -0,0 +1 @@ +Add background update to clean out left rooms from current state. diff --git a/synapse/storage/data_stores/main/state.py b/synapse/storage/data_stores/main/state.py index 9b6f68e777645c80cea3b9bf411a88286878b3b4..4167f83c9b682b31d47bb3b0fb1c34bac652556f 100644 --- a/synapse/storage/data_stores/main/state.py +++ b/synapse/storage/data_stores/main/state.py @@ -365,6 +365,8 @@ class MainStateBackgroundUpdateStore(RoomMemberWorkerStore): left_rooms = set(room_ids) - joined_room_ids + logger.info("Deleting current state left rooms: %r", left_rooms) + # First we get all users that we still think were joined to the # room. This is so that we can mark those device lists as # potentially stale, since there may have been a period where the