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 <public@benj.me>
This commit is contained in:
Benjamin Bouvier 2023-06-06 19:33:35 +02:00
parent 407375ad17
commit 3b10c235ab
2 changed files with 8 additions and 1 deletions

View File

@ -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))

View File

@ -252,6 +252,9 @@ async fn test_sync_from_init_to_enjoy() -> Result<(), Error> {
"to_device": {
"enabled": true,
},
"account_data": {
"enabled": true
}
},
},
respond with = {