From 3b10c235ab48d22c9414b82f053b498089abb213 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 6 Jun 2023 19:33:35 +0200 Subject: [PATCH] sliding sync: enable account data extension in room list API This extension was enabled by both ElementX apps by default, along with the e2ee / to-device extensions that will be handled by the new Notification API. To maintain the current behavior, it's important to re-enable this extension before getting RoomList in production. Signed-off-by: Benjamin Bouvier --- crates/matrix-sdk-ui/src/room_list/mod.rs | 6 +++++- crates/matrix-sdk-ui/tests/integration/room_list.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/matrix-sdk-ui/src/room_list/mod.rs b/crates/matrix-sdk-ui/src/room_list/mod.rs index fadf3b986..f6b8c5a4b 100644 --- a/crates/matrix-sdk-ui/src/room_list/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list/mod.rs @@ -74,7 +74,7 @@ use matrix_sdk::{ SlidingSyncMode, SlidingSyncRoom, }; use once_cell::sync::Lazy; -use ruma::{OwnedRoomId, RoomId}; +use ruma::{api::client::sync::sync_events::v4::AccountDataConfig, assign, OwnedRoomId, RoomId}; use thiserror::Error; use crate::{timeline::EventTimelineItem, Timeline}; @@ -100,6 +100,10 @@ impl RoomList { .map_err(Error::SlidingSync)? .enable_caching() .map_err(Error::SlidingSync)? + // Enable the account data extension. + .with_account_data_extension( + assign! { AccountDataConfig::default(), { enabled: Some(true) }}, + ) .add_cached_list( SlidingSyncList::builder(ALL_ROOMS_LIST_NAME) .sync_mode(SlidingSyncMode::new_selective().add_range(0..=19)) diff --git a/crates/matrix-sdk-ui/tests/integration/room_list.rs b/crates/matrix-sdk-ui/tests/integration/room_list.rs index 1da379f18..16738f654 100644 --- a/crates/matrix-sdk-ui/tests/integration/room_list.rs +++ b/crates/matrix-sdk-ui/tests/integration/room_list.rs @@ -252,6 +252,9 @@ async fn test_sync_from_init_to_enjoy() -> Result<(), Error> { "to_device": { "enabled": true, }, + "account_data": { + "enabled": true + } }, }, respond with = {