Skip to content

room_stats_current.current_state_events database table is not updated when the server is no longer in the room #17457

Open
@MadLittleMods

Description

@MadLittleMods

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

  1. Create a room
  2. Notice the current_state_events count is > 0 (probably 7) in the database: psql synapse -> SELECT * FROM room_stats_current WHERE room_id = '!my-room'
  3. Leave the room (no one else should be left in the room) which will cause the server to no longer be in the room
  4. 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'
  5. Notice the current_state_events count is still 7 in the database (unexpected ❌): psql synapse -> SELECT * FROM room_stats_current WHERE room_id = '!my-room'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions