Trace current_state_events

This commit is contained in:
Eric Eastwood 2024-08-22 19:59:21 -05:00
parent 65c0fd5a61
commit 664065a44e
2 changed files with 13 additions and 0 deletions

View file

@ -1155,6 +1155,8 @@ class PersistEventsStore:
to_delete = delta_state.to_delete
to_insert = delta_state.to_insert
logger.info("asdf _update_current_state_txn: %s %s", to_delete, to_insert)
# Figure out the changes of membership to invalidate the
# `get_rooms_for_user` cache.
# We find out which membership events we may have deleted

View file

@ -681,6 +681,17 @@ class PartialJoinTestCase(unittest.FederatingHomeserverTestCase):
f" failed do_invite_join!",
)
# Sanity check that we're not leaving behind any current state events.
current_state_check_rows = self.get_success(
store.db_pool.simple_select_list(
table="current_state_events",
keyvalues={"room_id": room_id},
retcols=("event_id",),
desc="check current_state_events in test",
)
)
self.assertEqual(len(current_state_check_rows), 0)
def test_duplicate_partial_state_room_syncs(self) -> None:
"""
Tests that concurrent partial state syncs are not started for the same room.