mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-11 12:17:54 +00:00
`rust/src/sliding_sync/required_state.rs` holds `_required_state_changes` and the derivation in `get_room_sync_data` of the state filter and the member sets from a room's `required_state` and timeline. The Python derivation moves, unchanged, into two module-level helpers, `_required_state_request` and `_state_filter_with_meta`, so the differential tests can call it. Python's results depend on set iteration order in three places, and Rust takes one of Python's possible outcomes in each: - The previous state keys kept over the 100-key cap: Python slices a set, Rust takes the first in sorted order. - Converting explicit members to lazy ones reads a loop variable that leaked out of the loops before it. Without state deltas, Python's is the last type of a set union in hash order, so whether those members join the lazy cache varies between processes. Rust reads `m.room.member`'s. - `must_await_full_state` raises on an empty state key under the `*` type, unless a remote user ID comes first in the set. Rust checks the user IDs first. The tests compare over 3000 generated inputs each, and allow exactly these differences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L51DoxB8VnH8UjXJFDgpNG