Skip to content

Conversation

@erikjohnston
Copy link
Member

When we change the required_state config for a room in sliding sync, we insert a new entry into the sliding_sync_connection_required_state table. As the sliding sync connection advances we can accrue a lot of stale entries, so let's clear those out.

This is a sort of follow on from #19211

@erikjohnston erikjohnston marked this pull request as ready for review December 15, 2025 14:02
@erikjohnston erikjohnston requested a review from a team as a code owner December 15, 2025 14:02
required_state_id for _, _, required_state_id in room_config_rows
}

unused_required_state_ids = required_state_map.keys() - used_required_state_ids
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong 🤔

required_state_map.keys() will be things like the state event types requested.

used_required_state_ids is a bunch of required_state_id which is an auto-incrementing number.

(connection_key, required_state_id)
for required_state_id in unused_required_state_ids
],
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably could use a test to sanity check the database looks fine after this runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants