From 460c04c11acdd2e88f030e29a29e8be820d0e6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Fri, 8 Nov 2024 16:17:44 +0100 Subject: [PATCH] feat(sliding_sync): Add `m.room.join_rules` to the required state We need the join rules state event to prevent the SDK from assuming a room with an unknown (as in, not loaded) join rule is public. --- crates/matrix-sdk-ui/src/room_list_service/mod.rs | 1 + crates/matrix-sdk-ui/tests/integration/room_list_service.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/crates/matrix-sdk-ui/src/room_list_service/mod.rs b/crates/matrix-sdk-ui/src/room_list_service/mod.rs index 5a52f610757..cde34078ce9 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/mod.rs @@ -88,6 +88,7 @@ const DEFAULT_REQUIRED_STATE: &[(StateEventType, &str)] = &[ (StateEventType::RoomCanonicalAlias, ""), (StateEventType::RoomPowerLevels, ""), (StateEventType::CallMember, "*"), + (StateEventType::RoomJoinRules, ""), ]; /// The default `required_state` constant value for sliding sync room diff --git a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs index 0c9429203e3..c8b150f7b51 100644 --- a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs +++ b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs @@ -357,6 +357,7 @@ async fn test_sync_all_states() -> Result<(), Error> { ["m.room.canonical_alias", ""], ["m.room.power_levels", ""], ["org.matrix.msc3401.call.member", "*"], + ["m.room.join_rules", ""], ], "include_heroes": true, "filters": { @@ -2220,6 +2221,7 @@ async fn test_room_subscription() -> Result<(), Error> { ["m.room.canonical_alias", ""], ["m.room.power_levels", ""], ["org.matrix.msc3401.call.member", "*"], + ["m.room.join_rules", ""], ["m.room.create", ""], ["m.room.pinned_events", ""], ], @@ -2258,6 +2260,7 @@ async fn test_room_subscription() -> Result<(), Error> { ["m.room.canonical_alias", ""], ["m.room.power_levels", ""], ["org.matrix.msc3401.call.member", "*"], + ["m.room.join_rules", ""], ["m.room.create", ""], ["m.room.pinned_events", ""], ],