Open
Description
When a server is no longer in a room, the current_state_events
table is cleared for that room_id
. But we never update the room_stats_current
table -> current_state_events
to reflect this state.
The room_stats_current.joined_members
does get updated 0
though.
Reproduction instructions
- Create a room
- Notice the
current_state_events
count is > 0 (probably7
) in the database:psql synapse
->SELECT * FROM room_stats_current WHERE room_id = '!my-room'
- Leave the room (no one else should be left in the room) which will cause the server to no longer be in the room
- The
current_state_events
will be cleared out for that room (0 rows, expected ✅ ):psql synapse
->SELECT * FROM current_state_events WHERE room_id = '!my-room'
- Notice the
current_state_events
count is still7
in the database (unexpected ❌):psql synapse
->SELECT * FROM room_stats_current WHERE room_id = '!my-room'