From bdfc300e4cd45c11eb152a16de451ee3e699abd5 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 12 Aug 2024 14:51:05 +0200 Subject: [PATCH] feat(sdk): `compute_limited` is only useful for the SS proxy. This patch restricts the call to `compute_limited` to the sliding sync proxy implementation (aka MCS3575). It is not necessary for the sliding sync native implementation (aka Simplified MSC3575). The proxy doesn't implement the `limited` flag, contrary to Synapse. Let's not run workarounds when we don't need them. --- crates/matrix-sdk/src/sliding_sync/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk/src/sliding_sync/mod.rs b/crates/matrix-sdk/src/sliding_sync/mod.rs index 5ee776a09..8dc5367f2 100644 --- a/crates/matrix-sdk/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk/src/sliding_sync/mod.rs @@ -259,8 +259,9 @@ impl SlidingSync { trace!(yes = must_process_rooms_response, "Must process rooms response?"); - // Compute `limited`, if we're interested in a room list query. - if must_process_rooms_response { + // Compute `limited` for the SS proxy only, if we're interested in a room list + // query. + if !self.inner.client.is_simplified_sliding_sync_enabled() && must_process_rooms_response { let known_rooms = self.inner.rooms.read().await; compute_limited(&known_rooms, &mut sliding_sync_response.rooms); }