From 61dd560499127d79c2afce64938a6db9685d5ca9 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 8 Jan 2025 13:12:00 +0100 Subject: [PATCH] feat: Remove the `experimental-sliding-sync` feature flag. Sliding sync is no longer experimental. It has a solid MSC4186, along with a solid implementation inside Synapse. It's time to consider it mature. The SDK continues to support the old MSC3575 in addition to MSC4186. This patch only removes the `experimental-sliding-sync` feature flag. --- bindings/matrix-sdk-ffi/Cargo.toml | 2 - crates/matrix-sdk-base/Cargo.toml | 13 +++-- crates/matrix-sdk-base/src/client.rs | 16 +++--- crates/matrix-sdk-base/src/latest_event.rs | 34 ++++++++---- crates/matrix-sdk-base/src/lib.rs | 1 - crates/matrix-sdk-base/src/rooms/normal.rs | 54 ++++++------------- .../matrix-sdk-base/src/sliding_sync/mod.rs | 38 ++++++++++--- .../src/store/migration_helpers.rs | 8 +-- crates/matrix-sdk-base/src/store/mod.rs | 1 - crates/matrix-sdk-ui/Cargo.toml | 2 +- crates/matrix-sdk/Cargo.toml | 8 +-- crates/matrix-sdk/src/client/builder/mod.rs | 35 +++--------- crates/matrix-sdk/src/client/futures.rs | 1 - crates/matrix-sdk/src/client/mod.rs | 11 ++-- crates/matrix-sdk/src/error.rs | 1 - crates/matrix-sdk/src/http_client/mod.rs | 9 ---- crates/matrix-sdk/src/lib.rs | 2 - crates/matrix-sdk/src/sliding_sync/cache.rs | 4 +- .../tests/integration/encryption/backups.rs | 1 - .../tests/integration/room_preview.rs | 14 +++-- xtask/src/ci.rs | 7 +-- 21 files changed, 112 insertions(+), 150 deletions(-) diff --git a/bindings/matrix-sdk-ffi/Cargo.toml b/bindings/matrix-sdk-ffi/Cargo.toml index 4268a0220f0..b771e6f5759 100644 --- a/bindings/matrix-sdk-ffi/Cargo.toml +++ b/bindings/matrix-sdk-ffi/Cargo.toml @@ -56,7 +56,6 @@ features = [ "anyhow", "e2e-encryption", "experimental-oidc", - "experimental-sliding-sync", "experimental-widgets", "markdown", "rustls-tls", # note: differ from block below @@ -71,7 +70,6 @@ features = [ "anyhow", "e2e-encryption", "experimental-oidc", - "experimental-sliding-sync", "experimental-widgets", "markdown", "native-tls", # note: differ from block above diff --git a/crates/matrix-sdk-base/Cargo.toml b/crates/matrix-sdk-base/Cargo.toml index 363b1c8036c..68daed73eb1 100644 --- a/crates/matrix-sdk-base/Cargo.toml +++ b/crates/matrix-sdk-base/Cargo.toml @@ -21,10 +21,6 @@ e2e-encryption = ["dep:matrix-sdk-crypto"] js = ["matrix-sdk-common/js", "matrix-sdk-crypto?/js", "ruma/js", "matrix-sdk-store-encryption/js"] qrcode = ["matrix-sdk-crypto?/qrcode"] automatic-room-key-forwarding = ["matrix-sdk-crypto?/automatic-room-key-forwarding"] -experimental-sliding-sync = [ - "ruma/unstable-msc3575", - "ruma/unstable-msc4186", -] uniffi = ["dep:uniffi", "matrix-sdk-crypto?/uniffi", "matrix-sdk-common/uniffi"] # Private feature, see @@ -65,7 +61,14 @@ matrix-sdk-store-encryption = { workspace = true } matrix-sdk-test = { workspace = true, optional = true } once_cell = { workspace = true } regex = "1.11.1" -ruma = { workspace = true, features = ["canonical-json", "unstable-msc3381", "unstable-msc2867", "rand"] } +ruma = { workspace = true, features = [ + "canonical-json", + "unstable-msc2867", + "unstable-msc3381", + "unstable-msc3575", + "unstable-msc4186", + "rand", +] } unicode-normalization = { workspace = true } serde = { workspace = true, features = ["rc"] } serde_json = { workspace = true } diff --git a/crates/matrix-sdk-base/src/client.rs b/crates/matrix-sdk-base/src/client.rs index 790a6c00431..6456d4c6c90 100644 --- a/crates/matrix-sdk-base/src/client.rs +++ b/crates/matrix-sdk-base/src/client.rs @@ -63,7 +63,7 @@ use tokio::sync::{broadcast, Mutex}; use tokio::sync::{RwLock, RwLockReadGuard}; use tracing::{debug, error, info, instrument, trace, warn}; -#[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] +#[cfg(feature = "e2e-encryption")] use crate::latest_event::{is_suitable_for_latest_event, LatestEvent, PossibleLatestEvent}; #[cfg(feature = "e2e-encryption")] use crate::RoomMemberships; @@ -766,16 +766,12 @@ impl BaseClient { let (events, room_key_updates) = o.receive_sync_changes(encryption_sync_changes).await?; - #[cfg(feature = "experimental-sliding-sync")] for room_key_update in room_key_updates { if let Some(room) = self.get_room(&room_key_update.room_id) { self.decrypt_latest_events(&room, changes, room_info_notable_updates).await; } } - #[cfg(not(feature = "experimental-sliding-sync"))] // Silence unused variable warnings. - let _ = (room_key_updates, changes, room_info_notable_updates); - Ok(events) } else { // If we have no OlmMachine, just return the events that were passed in. @@ -789,7 +785,7 @@ impl BaseClient { /// that we can and if we can, change latest_event to reflect what we /// found, and remove any older encrypted events from /// latest_encrypted_events. - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] async fn decrypt_latest_events( &self, room: &Room, @@ -810,7 +806,7 @@ impl BaseClient { /// (i.e. we can usefully display it as a message preview). Returns the /// decrypted event if we found one, along with its index in the /// latest_encrypted_events list, or None if we didn't find one. - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] async fn decrypt_latest_suitable_event( &self, room: &Room, @@ -1747,7 +1743,9 @@ mod tests { async_test, ruma_response_from_json, sync_timeline_event, InvitedRoomBuilder, LeftRoomBuilder, StateTestEvent, StrippedStateTestEvent, SyncResponseBuilder, }; - use ruma::{api::client as api, room_id, serde::Raw, user_id, UserId}; + #[cfg(feature = "e2e-encryption")] + use ruma::UserId; + use ruma::{api::client as api, room_id, serde::Raw, user_id}; use serde_json::{json, value::to_raw_value}; use super::BaseClient; @@ -1889,7 +1887,7 @@ mod tests { ); } - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_when_there_are_no_latest_encrypted_events_decrypting_them_does_nothing() { use std::collections::BTreeMap; diff --git a/crates/matrix-sdk-base/src/latest_event.rs b/crates/matrix-sdk-base/src/latest_event.rs index 7884d585193..d610ec90ff5 100644 --- a/crates/matrix-sdk-base/src/latest_event.rs +++ b/crates/matrix-sdk-base/src/latest_event.rs @@ -1,8 +1,6 @@ //! Utilities for working with events to decide whether they are suitable for //! use as a [crate::Room::latest_event]. -#![cfg(any(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] - use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; #[cfg(feature = "e2e-encryption")] use ruma::{ @@ -10,9 +8,11 @@ use ruma::{ call::{invite::SyncCallInviteEvent, notify::SyncCallNotifyEvent}, poll::unstable_start::SyncUnstablePollStartEvent, relation::RelationType, - room::member::{MembershipState, SyncRoomMemberEvent}, - room::message::SyncRoomMessageEvent, - room::power_levels::RoomPowerLevels, + room::{ + member::{MembershipState, SyncRoomMemberEvent}, + message::SyncRoomMessageEvent, + power_levels::RoomPowerLevels, + }, sticker::SyncStickerEvent, AnySyncMessageLikeEvent, AnySyncStateEvent, AnySyncTimelineEvent, }, @@ -294,11 +294,16 @@ impl LatestEvent { #[cfg(test)] mod tests { + #[cfg(feature = "e2e-encryption")] use std::collections::BTreeMap; + #[cfg(feature = "e2e-encryption")] use assert_matches::assert_matches; + #[cfg(feature = "e2e-encryption")] use assert_matches2::assert_let; use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; + use ruma::serde::Raw; + #[cfg(feature = "e2e-encryption")] use ruma::{ events::{ call::{ @@ -336,14 +341,16 @@ mod tests { RedactedSyncMessageLikeEvent, RedactedUnsigned, StateUnsigned, SyncMessageLikeEvent, UnsignedRoomRedactionEvent, }, - owned_event_id, owned_mxc_uri, owned_user_id, - serde::Raw, - MilliSecondsSinceUnixEpoch, UInt, VoipVersionId, + owned_event_id, owned_mxc_uri, owned_user_id, MilliSecondsSinceUnixEpoch, UInt, + VoipVersionId, }; use serde_json::json; - use crate::latest_event::{is_suitable_for_latest_event, LatestEvent, PossibleLatestEvent}; + use super::LatestEvent; + #[cfg(feature = "e2e-encryption")] + use super::{is_suitable_for_latest_event, PossibleLatestEvent}; + #[cfg(feature = "e2e-encryption")] #[test] fn test_room_messages_are_suitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::RoomMessage( @@ -368,6 +375,7 @@ mod tests { assert_eq!(m.content.msgtype.msgtype(), "m.image"); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_polls_are_suitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::UnstablePollStart( @@ -391,6 +399,7 @@ mod tests { assert_eq!(m.content.poll_start().question.text, "do you like rust?"); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_call_invites_are_suitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::CallInvite( @@ -413,6 +422,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_call_notifications_are_suitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::CallNotify( @@ -435,6 +445,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_stickers_are_suitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::Sticker( @@ -457,6 +468,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_different_types_of_messagelike_are_unsuitable() { let event = @@ -479,6 +491,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_redacted_messages_are_suitable() { // Ruma does not allow constructing UnsignedRoomRedactionEvent instances. @@ -507,6 +520,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_encrypted_messages_are_unsuitable() { let event = AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::RoomEncrypted( @@ -530,6 +544,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_state_events_are_unsuitable() { let event = AnySyncTimelineEvent::State(AnySyncStateEvent::RoomTopic( @@ -549,6 +564,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[test] fn test_replacement_events_are_unsuitable() { let mut event_content = RoomMessageEventContent::text_plain("Bye bye, world!"); diff --git a/crates/matrix-sdk-base/src/lib.rs b/crates/matrix-sdk-base/src/lib.rs index 1c37a915f52..ba165ba8026 100644 --- a/crates/matrix-sdk-base/src/lib.rs +++ b/crates/matrix-sdk-base/src/lib.rs @@ -38,7 +38,6 @@ mod rooms; pub mod read_receipts; pub use read_receipts::PreviousEventsProvider; pub use rooms::RoomMembersUpdate; -#[cfg(feature = "experimental-sliding-sync")] pub mod sliding_sync; pub mod store; diff --git a/crates/matrix-sdk-base/src/rooms/normal.rs b/crates/matrix-sdk-base/src/rooms/normal.rs index 204a64d512a..3a1b8a61d75 100644 --- a/crates/matrix-sdk-base/src/rooms/normal.rs +++ b/crates/matrix-sdk-base/src/rooms/normal.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] +#[cfg(feature = "e2e-encryption")] use std::sync::RwLock as SyncRwLock; use std::{ collections::{BTreeMap, BTreeSet, HashSet}, @@ -24,12 +24,9 @@ use as_variant::as_variant; use bitflags::bitflags; use eyeball::{AsyncLock, ObservableWriteGuard, SharedObservable, Subscriber}; use futures_util::{Stream, StreamExt}; -#[cfg(feature = "experimental-sliding-sync")] use matrix_sdk_common::deserialized_responses::TimelineEventKind; -#[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] +#[cfg(feature = "e2e-encryption")] use matrix_sdk_common::ring_buffer::RingBuffer; -#[cfg(feature = "experimental-sliding-sync")] -use ruma::events::AnySyncTimelineEvent; use ruma::{ api::client::sync::sync_events::v3::RoomSummary as RumaSummary, events::{ @@ -51,7 +48,7 @@ use ruma::{ tombstone::RoomTombstoneEventContent, }, tag::{TagEventContent, Tags}, - AnyRoomAccountDataEvent, AnyStrippedStateEvent, AnySyncStateEvent, + AnyRoomAccountDataEvent, AnyStrippedStateEvent, AnySyncStateEvent, AnySyncTimelineEvent, RoomAccountDataEventType, StateEventType, SyncStateEvent, }, room::RoomType, @@ -67,12 +64,11 @@ use super::{ members::MemberRoomInfo, BaseRoomInfo, RoomCreateWithCreatorEventContent, RoomDisplayName, RoomMember, RoomNotableTags, }; -#[cfg(feature = "experimental-sliding-sync")] -use crate::latest_event::LatestEvent; use crate::{ deserialized_responses::{ DisplayName, MemberEvent, RawMemberEvent, RawSyncOrStrippedState, SyncOrStrippedState, }, + latest_event::LatestEvent, notification_settings::RoomNotificationMode, read_receipts::RoomReadReceipts, store::{DynStateStore, Result as StoreResult, StateStoreExt}, @@ -166,7 +162,7 @@ pub struct Room { /// not sure whether holding too many of them might make the cache too /// slow to load on startup. Keeping them here means they are not cached /// to disk but held in memory. - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] pub latest_encrypted_events: Arc>>>, /// A map for ids of room membership events in the knocking state linked to @@ -277,7 +273,7 @@ pub enum RoomMembersUpdate { impl Room { /// The size of the latest_encrypted_events RingBuffer // SAFETY: `new_unchecked` is safe because 10 is not zero. - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] const MAX_ENCRYPTED_EVENTS: std::num::NonZeroUsize = unsafe { std::num::NonZeroUsize::new_unchecked(10) }; @@ -304,7 +300,7 @@ impl Room { room_id: room_info.room_id.clone(), store, inner: SharedObservable::new(room_info), - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] latest_encrypted_events: Arc::new(SyncRwLock::new(RingBuffer::new( Self::MAX_ENCRYPTED_EVENTS, ))), @@ -925,7 +921,6 @@ impl Room { /// Return the last event in this room, if one has been cached during /// sliding sync. - #[cfg(feature = "experimental-sliding-sync")] pub fn latest_event(&self) -> Option { self.inner.read().latest_event.as_deref().cloned() } @@ -934,7 +929,7 @@ impl Room { /// to decrypt these, the most recent relevant one will replace /// latest_event. (We can't tell which one is relevant until /// they are decrypted.) - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] pub(crate) fn latest_encrypted_events(&self) -> Vec> { self.latest_encrypted_events.read().unwrap().iter().cloned().collect() } @@ -949,7 +944,7 @@ impl Room { /// /// It is the responsibility of the caller to apply the changes into the /// state store after calling this function. - #[cfg(all(feature = "e2e-encryption", feature = "experimental-sliding-sync"))] + #[cfg(feature = "e2e-encryption")] pub(crate) fn on_latest_event_decrypted( &self, latest_event: Box, @@ -1195,7 +1190,6 @@ impl Room { /// Returns the recency stamp of the room. /// /// Please read `RoomInfo::recency_stamp` to learn more. - #[cfg(feature = "experimental-sliding-sync")] pub fn recency_stamp(&self) -> Option { self.inner.read().recency_stamp } @@ -1405,7 +1399,6 @@ pub struct RoomInfo { pub(crate) encryption_state_synced: bool, /// The last event send by sliding sync - #[cfg(feature = "experimental-sliding-sync")] pub(crate) latest_event: Option>, /// Information about read receipts for this room. @@ -1439,7 +1432,6 @@ pub struct RoomInfo { /// Sliding Sync might "ignoreā€¯ some events when computing the recency /// stamp of the room. Thus, using this `recency_stamp` value is /// more accurate than relying on the latest event. - #[cfg(feature = "experimental-sliding-sync")] #[serde(default)] pub(crate) recency_stamp: Option, } @@ -1475,14 +1467,12 @@ impl RoomInfo { last_prev_batch: None, sync_info: SyncInfo::NoState, encryption_state_synced: false, - #[cfg(feature = "experimental-sliding-sync")] latest_event: None, read_receipts: Default::default(), base_info: Box::new(BaseRoomInfo::new()), warned_about_unknown_room_version: Arc::new(false.into()), cached_display_name: None, cached_user_defined_notification_mode: None, - #[cfg(feature = "experimental-sliding-sync")] recency_stamp: None, } } @@ -1627,7 +1617,6 @@ impl RoomInfo { }; tracing::Span::current().record("redacts", debug(redacts)); - #[cfg(feature = "experimental-sliding-sync")] if let Some(latest_event) = &mut self.latest_event { tracing::trace!("Checking if redaction applies to latest event"); if latest_event.event_id().as_deref() == Some(redacts) { @@ -1717,19 +1706,16 @@ impl RoomInfo { } /// Updates the joined member count. - #[cfg(feature = "experimental-sliding-sync")] pub(crate) fn update_joined_member_count(&mut self, count: u64) { self.summary.joined_member_count = count; } /// Updates the invited member count. - #[cfg(feature = "experimental-sliding-sync")] pub(crate) fn update_invited_member_count(&mut self, count: u64) { self.summary.invited_member_count = count; } /// Updates the room heroes. - #[cfg(feature = "experimental-sliding-sync")] pub(crate) fn update_heroes(&mut self, heroes: Vec) { self.summary.room_heroes = heroes; } @@ -1929,7 +1915,6 @@ impl RoomInfo { } /// Returns the latest (decrypted) event recorded for this room. - #[cfg(feature = "experimental-sliding-sync")] pub fn latest_event(&self) -> Option<&LatestEvent> { self.latest_event.as_deref() } @@ -1937,7 +1922,6 @@ impl RoomInfo { /// Updates the recency stamp of this room. /// /// Please read [`Self::recency_stamp`] to learn more. - #[cfg(feature = "experimental-sliding-sync")] pub(crate) fn update_recency_stamp(&mut self, stamp: u64) { self.recency_stamp = Some(stamp); } @@ -2023,7 +2007,6 @@ impl RoomInfo { } } -#[cfg(feature = "experimental-sliding-sync")] fn apply_redaction( event: &Raw, raw_redaction: &Raw, @@ -2168,7 +2151,6 @@ mod tests { }; use assign::assign; - #[cfg(feature = "experimental-sliding-sync")] use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; use matrix_sdk_test::{ async_test, @@ -2205,9 +2187,8 @@ mod tests { use stream_assert::{assert_pending, assert_ready}; use super::{compute_display_name_from_heroes, Room, RoomHero, RoomInfo, RoomState, SyncInfo}; - #[cfg(any(feature = "experimental-sliding-sync", feature = "e2e-encryption"))] - use crate::latest_event::LatestEvent; use crate::{ + latest_event::LatestEvent, rooms::RoomNotableTags, store::{IntoStateStore, MemoryStore, StateChanges, StateStore, StoreConfig}, test_utils::logged_in_base_client, @@ -2216,7 +2197,6 @@ mod tests { }; #[test] - #[cfg(feature = "experimental-sliding-sync")] fn test_room_info_serialization() { // This test exists to make sure we don't accidentally change the // serialized format for `RoomInfo`. @@ -2403,7 +2383,6 @@ mod tests { } #[test] - #[cfg(feature = "experimental-sliding-sync")] fn test_room_info_deserialization() { use ruma::{owned_mxc_uri, owned_user_id}; @@ -3153,8 +3132,8 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_setting_the_latest_event_doesnt_cause_a_room_info_notable_update() { use std::collections::BTreeMap; @@ -3173,7 +3152,6 @@ mod tests { user_id: user_id!("@alice:example.org").into(), device_id: ruma::device_id!("AYEAYEAYE").into(), }, - #[cfg(feature = "e2e-encryption")] None, ) .await @@ -3221,8 +3199,8 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_when_we_provide_a_newly_decrypted_event_it_replaces_latest_event() { use std::collections::BTreeMap; @@ -3251,8 +3229,8 @@ mod tests { assert_eq!(room.latest_event().unwrap().event_id(), event.event_id()); } + #[cfg(feature = "e2e-encryption")] #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_when_a_newly_decrypted_event_appears_we_delete_all_older_encrypted_events() { use std::collections::BTreeMap; @@ -3290,8 +3268,8 @@ mod tests { assert_eq!(room.latest_event().unwrap().event_id(), new_event.event_id()); } + #[cfg(feature = "e2e-encryption")] #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_replacing_the_newest_event_leaves_none_left() { use std::collections::BTreeMap; @@ -3323,7 +3301,7 @@ mod tests { assert_eq!(enc_evs.len(), 0); } - #[cfg(feature = "experimental-sliding-sync")] + #[cfg(feature = "e2e-encryption")] fn add_encrypted_event(room: &Room, event_id: &str) { room.latest_encrypted_events .write() @@ -3331,7 +3309,7 @@ mod tests { .push(Raw::from_json_string(json!({ "event_id": event_id }).to_string()).unwrap()); } - #[cfg(feature = "experimental-sliding-sync")] + #[cfg(feature = "e2e-encryption")] fn make_latest_event(event_id: &str) -> Box { Box::new(LatestEvent::new(SyncTimelineEvent::new( Raw::from_json_string(json!({ "event_id": event_id }).to_string()).unwrap(), diff --git a/crates/matrix-sdk-base/src/sliding_sync/mod.rs b/crates/matrix-sdk-base/src/sliding_sync/mod.rs index a5b7d726c3d..c9db56c8eb1 100644 --- a/crates/matrix-sdk-base/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk-base/src/sliding_sync/mod.rs @@ -895,14 +895,15 @@ fn process_room_properties( #[cfg(test)] mod tests { - use std::{ - collections::{BTreeMap, HashSet}, - sync::{Arc, RwLock as SyncRwLock}, - }; + use std::collections::{BTreeMap, HashSet}; + #[cfg(feature = "e2e-encryption")] + use std::sync::{Arc, RwLock as SyncRwLock}; use assert_matches::assert_matches; + use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; + #[cfg(feature = "e2e-encryption")] use matrix_sdk_common::{ - deserialized_responses::{SyncTimelineEvent, UnableToDecryptInfo, UnableToDecryptReason}, + deserialized_responses::{UnableToDecryptInfo, UnableToDecryptReason}, ring_buffer::RingBuffer, }; use matrix_sdk_test::async_test; @@ -928,13 +929,16 @@ mod tests { }; use serde_json::json; - use super::{cache_latest_events, http}; + #[cfg(feature = "e2e-encryption")] + use super::cache_latest_events; + use super::http; use crate::{ rooms::normal::{RoomHero, RoomInfoNotableUpdateReasons}, - store::MemoryStore, test_utils::logged_in_base_client, - BaseClient, Room, RoomInfoNotableUpdate, RoomState, + BaseClient, RoomInfoNotableUpdate, RoomState, }; + #[cfg(feature = "e2e-encryption")] + use crate::{store::MemoryStore, Room}; #[async_test] async fn test_notification_count_set() { @@ -1938,6 +1942,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_when_no_events_we_dont_cache_any() { let events = &[]; @@ -1945,6 +1950,7 @@ mod tests { assert!(chosen.is_none()); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_when_only_one_event_we_cache_it() { let event1 = make_event("m.room.message", "$1"); @@ -1953,6 +1959,7 @@ mod tests { assert_eq!(ev_id(chosen), rawev_id(event1)); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_with_multiple_events_we_cache_the_last_one() { let event1 = make_event("m.room.message", "$1"); @@ -1962,6 +1969,7 @@ mod tests { assert_eq!(ev_id(chosen), rawev_id(event2)); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_cache_the_latest_relevant_event_and_ignore_irrelevant_ones_even_if_later() { let event1 = make_event("m.room.message", "$1"); @@ -1973,6 +1981,7 @@ mod tests { assert_eq!(ev_id(chosen), rawev_id(event2)); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_prefer_to_cache_nothing_rather_than_irrelevant_events() { let event1 = make_event("m.room.power_levels", "$1"); @@ -1981,6 +1990,7 @@ mod tests { assert!(chosen.is_none()); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_cache_encrypted_events_that_are_after_latest_message() { // Given two message events followed by two encrypted @@ -2011,6 +2021,7 @@ mod tests { assert_eq!(rawevs_ids(&room.latest_encrypted_events), evs_ids(&[event3, event4])); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_dont_cache_encrypted_events_that_are_before_latest_message() { // Given an encrypted event before and after the message @@ -2035,6 +2046,7 @@ mod tests { assert_eq!(rawevs_ids(&room.latest_encrypted_events), evs_ids(&[event3])); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_skip_irrelevant_events_eg_receipts_even_if_after_message() { // Given two message events followed by two encrypted, with a receipt in the @@ -2062,6 +2074,7 @@ mod tests { assert_eq!(rawevs_ids(&room.latest_encrypted_events), evs_ids(&[event3, event5])); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_only_store_the_max_number_of_encrypted_events() { // Given two message events followed by lots of encrypted and other irrelevant @@ -2120,6 +2133,7 @@ mod tests { ); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_dont_overflow_capacity_if_previous_encrypted_events_exist() { // Given a RoomInfo with lots of encrypted events already inside it @@ -2162,6 +2176,7 @@ mod tests { assert_eq!(rawevs_ids(&room.latest_encrypted_events)[9], "$a"); } + #[cfg(feature = "e2e-encryption")] #[async_test] async fn test_existing_encrypted_events_are_deleted_if_we_receive_unencrypted() { // Given a RoomInfo with some encrypted events already inside it @@ -2590,6 +2605,7 @@ mod tests { assert!(room_2.is_direct().await.unwrap()); } + #[cfg(feature = "e2e-encryption")] async fn choose_event_to_cache(events: &[SyncTimelineEvent]) -> Option { let room = make_room(); let mut room_info = room.clone_info(); @@ -2598,6 +2614,7 @@ mod tests { room.latest_event().map(|latest_event| latest_event.event().clone()) } + #[cfg(feature = "e2e-encryption")] fn rawev_id(event: SyncTimelineEvent) -> String { event.event_id().unwrap().to_string() } @@ -2606,14 +2623,17 @@ mod tests { event.unwrap().event_id().unwrap().to_string() } + #[cfg(feature = "e2e-encryption")] fn rawevs_ids(events: &Arc>>>) -> Vec { events.read().unwrap().iter().map(|e| e.get_field("event_id").unwrap().unwrap()).collect() } + #[cfg(feature = "e2e-encryption")] fn evs_ids(events: &[SyncTimelineEvent]) -> Vec { events.iter().map(|e| e.event_id().unwrap().to_string()).collect() } + #[cfg(feature = "e2e-encryption")] fn make_room() -> Room { let (sender, _receiver) = tokio::sync::broadcast::channel(1); @@ -2640,10 +2660,12 @@ mod tests { .unwrap() } + #[cfg(feature = "e2e-encryption")] fn make_event(typ: &str, id: &str) -> SyncTimelineEvent { SyncTimelineEvent::new(make_raw_event(typ, id)) } + #[cfg(feature = "e2e-encryption")] fn make_encrypted_event(id: &str) -> SyncTimelineEvent { SyncTimelineEvent::new_utd_event( Raw::from_json_string( diff --git a/crates/matrix-sdk-base/src/store/migration_helpers.rs b/crates/matrix-sdk-base/src/store/migration_helpers.rs index c8164096757..e38be077036 100644 --- a/crates/matrix-sdk-base/src/store/migration_helpers.rs +++ b/crates/matrix-sdk-base/src/store/migration_helpers.rs @@ -19,7 +19,6 @@ use std::{ sync::Arc, }; -#[cfg(feature = "experimental-sliding-sync")] use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; use ruma::{ events::{ @@ -42,10 +41,9 @@ use ruma::{ }; use serde::{Deserialize, Serialize}; -#[cfg(feature = "experimental-sliding-sync")] -use crate::latest_event::LatestEvent; use crate::{ deserialized_responses::SyncOrStrippedState, + latest_event::LatestEvent, rooms::{ normal::{RoomSummary, SyncInfo}, BaseRoomInfo, RoomNotableTags, @@ -78,7 +76,6 @@ pub struct RoomInfoV1 { sync_info: SyncInfo, #[serde(default = "encryption_state_default")] // see fn docs for why we use this default encryption_state_synced: bool, - #[cfg(feature = "experimental-sliding-sync")] latest_event: Option, base_info: BaseRoomInfoV1, } @@ -106,7 +103,6 @@ impl RoomInfoV1 { last_prev_batch, sync_info, encryption_state_synced, - #[cfg(feature = "experimental-sliding-sync")] latest_event, base_info, } = self; @@ -122,14 +118,12 @@ impl RoomInfoV1 { last_prev_batch, sync_info, encryption_state_synced, - #[cfg(feature = "experimental-sliding-sync")] latest_event: latest_event.map(|ev| Box::new(LatestEvent::new(ev))), read_receipts: Default::default(), base_info: base_info.migrate(create), warned_about_unknown_room_version: Arc::new(false.into()), cached_display_name: None, cached_user_defined_notification_mode: None, - #[cfg(feature = "experimental-sliding-sync")] recency_stamp: None, } } diff --git a/crates/matrix-sdk-base/src/store/mod.rs b/crates/matrix-sdk-base/src/store/mod.rs index fd31b917734..57c04a35900 100644 --- a/crates/matrix-sdk-base/src/store/mod.rs +++ b/crates/matrix-sdk-base/src/store/mod.rs @@ -276,7 +276,6 @@ impl Store { } /// Check if a room exists. - #[cfg(feature = "experimental-sliding-sync")] pub(crate) fn room_exists(&self, room_id: &RoomId) -> bool { self.rooms.read().unwrap().get(room_id).is_some() } diff --git a/crates/matrix-sdk-ui/Cargo.toml b/crates/matrix-sdk-ui/Cargo.toml index 2ba3efa8db5..2006e0f6397 100644 --- a/crates/matrix-sdk-ui/Cargo.toml +++ b/crates/matrix-sdk-ui/Cargo.toml @@ -35,7 +35,7 @@ growable-bloom-filter = { workspace = true } imbl = { workspace = true, features = ["serde"] } indexmap = { workspace = true } itertools = { workspace = true } -matrix-sdk = { workspace = true, features = ["experimental-sliding-sync", "e2e-encryption"] } +matrix-sdk = { workspace = true, features = ["e2e-encryption"] } matrix-sdk-base = { workspace = true } mime = { workspace = true } once_cell = { workspace = true } diff --git a/crates/matrix-sdk/Cargo.toml b/crates/matrix-sdk/Cargo.toml index 450f008491a..e7e0b3d1139 100644 --- a/crates/matrix-sdk/Cargo.toml +++ b/crates/matrix-sdk/Cargo.toml @@ -55,10 +55,6 @@ experimental-oidc = [ "dep:tower", "dep:openidconnect", ] -experimental-sliding-sync = [ - "matrix-sdk-base/experimental-sliding-sync", - "reqwest/gzip", -] experimental-widgets = ["dep:language-tags", "dep:uuid"] docsrs = ["e2e-encryption", "sqlite", "indexeddb", "sso-login", "qrcode"] @@ -119,7 +115,7 @@ zeroize = { workspace = true } [target.'cfg(target_arch = "wasm32")'.dependencies] gloo-timers = { workspace = true, features = ["futures"] } -reqwest = { workspace = true } +reqwest = { workspace = true, features = ["gzip"] } tokio = { workspace = true, features = ["macros"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] @@ -127,7 +123,7 @@ backoff = { version = "0.4.0", features = ["tokio"] } openidconnect = { version = "4.0.0-rc.1", optional = true } # only activate reqwest's stream feature on non-wasm, the wasm part seems to not # support *sending* streams, which makes it useless for us. -reqwest = { workspace = true, features = ["stream"] } +reqwest = { workspace = true, features = ["stream", "gzip"] } tokio = { workspace = true, features = ["fs", "rt", "macros"] } tokio-util = "0.7.12" wiremock = { workspace = true, optional = true } diff --git a/crates/matrix-sdk/src/client/builder/mod.rs b/crates/matrix-sdk/src/client/builder/mod.rs index f1606790517..8902f23608c 100644 --- a/crates/matrix-sdk/src/client/builder/mod.rs +++ b/crates/matrix-sdk/src/client/builder/mod.rs @@ -36,12 +36,10 @@ use crate::encryption::EncryptionSettings; use crate::http_client::HttpSettings; #[cfg(feature = "experimental-oidc")] use crate::oidc::OidcCtx; -#[cfg(feature = "experimental-sliding-sync")] -use crate::sliding_sync::VersionBuilder as SlidingSyncVersionBuilder; use crate::{ authentication::AuthCtx, client::ClientServerCapabilities, config::RequestConfig, - error::RumaApiError, http_client::HttpClient, send_queue::SendQueueData, HttpError, - IdParseError, + error::RumaApiError, http_client::HttpClient, send_queue::SendQueueData, + sliding_sync::VersionBuilder as SlidingSyncVersionBuilder, HttpError, IdParseError, }; /// Builder that allows creating and configuring various parts of a [`Client`]. @@ -86,7 +84,6 @@ use crate::{ #[derive(Clone, Debug)] pub struct ClientBuilder { homeserver_cfg: Option, - #[cfg(feature = "experimental-sliding-sync")] sliding_sync_version_builder: SlidingSyncVersionBuilder, http_cfg: Option, store_config: BuilderStoreConfig, @@ -110,7 +107,6 @@ impl ClientBuilder { pub(crate) fn new() -> Self { Self { homeserver_cfg: None, - #[cfg(feature = "experimental-sliding-sync")] sliding_sync_version_builder: SlidingSyncVersionBuilder::Native, http_cfg: None, store_config: BuilderStoreConfig::Custom(StoreConfig::new( @@ -195,7 +191,6 @@ impl ClientBuilder { } /// Set sliding sync to a specific version. - #[cfg(feature = "experimental-sliding-sync")] pub fn sliding_sync_version_builder( mut self, version_builder: SlidingSyncVersionBuilder, @@ -497,7 +492,6 @@ impl ClientBuilder { let HomeserverDiscoveryResult { server, homeserver, well_known, supported_versions } = homeserver_cfg.discover(&http_client).await?; - #[cfg(feature = "experimental-sliding-sync")] let sliding_sync_version = { let supported_versions = match supported_versions { Some(versions) => Some(versions), @@ -543,7 +537,6 @@ impl ClientBuilder { auth_ctx, server, homeserver, - #[cfg(feature = "experimental-sliding-sync")] sliding_sync_version, http_client, base_client, @@ -742,7 +735,6 @@ pub enum ClientBuildError { AutoDiscovery(FromHttpResponseError), /// Error when building the sliding sync version. - #[cfg(feature = "experimental-sliding-sync")] #[error(transparent)] SlidingSyncVersion(#[from] crate::sliding_sync::VersionBuilderError), @@ -771,7 +763,6 @@ pub(crate) mod tests { use assert_matches::assert_matches; use matrix_sdk_test::{async_test, test_json}; use serde_json::{json_internal, Value as JsonValue}; - #[cfg(feature = "experimental-sliding-sync")] use url::Url; use wiremock::{ matchers::{method, path}, @@ -779,7 +770,6 @@ pub(crate) mod tests { }; use super::*; - #[cfg(feature = "experimental-sliding-sync")] use crate::sliding_sync::Version as SlidingSyncVersion; #[test] @@ -861,7 +851,6 @@ pub(crate) mod tests { let _client = builder.build().await.unwrap(); // Then a client should be built with native support for sliding sync. - #[cfg(feature = "experimental-sliding-sync")] assert!(_client.sliding_sync_version().is_native()); } @@ -871,7 +860,6 @@ pub(crate) mod tests { // proxy injected. let homeserver = make_mock_homeserver().await; let mut builder = ClientBuilder::new(); - #[cfg(feature = "experimental-sliding-sync")] let url = { let url = Url::parse("https://localhost:1234").unwrap(); builder = builder.sliding_sync_version_builder(SlidingSyncVersionBuilder::Proxy { @@ -883,12 +871,11 @@ pub(crate) mod tests { // When building a client with the server's URL. builder = builder.server_name_or_homeserver_url(homeserver.uri()); - let _client = builder.build().await.unwrap(); + let client = builder.build().await.unwrap(); // Then a client should be built with support for sliding sync. - #[cfg(feature = "experimental-sliding-sync")] assert_matches!( - _client.sliding_sync_version(), + client.sliding_sync_version(), SlidingSyncVersion::Proxy { url: given_url } => { assert_eq!(given_url, url); } @@ -940,16 +927,14 @@ pub(crate) mod tests { // When building a client with the base server. builder = builder.server_name_or_homeserver_url(server.uri()); - let _client = builder.build().await.unwrap(); + let client = builder.build().await.unwrap(); // Then a client should be built with native support for sliding sync. // It's native support because it's the default. Nothing is checked here. - #[cfg(feature = "experimental-sliding-sync")] - assert!(_client.sliding_sync_version().is_native()); + assert!(client.sliding_sync_version().is_native()); } #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_discovery_well_known_with_sliding_sync() { // Given a base server with a well-known file that points to a homeserver with a // sliding sync proxy. @@ -971,12 +956,11 @@ pub(crate) mod tests { builder = builder .server_name_or_homeserver_url(server.uri()) .sliding_sync_version_builder(SlidingSyncVersionBuilder::DiscoverProxy); - let _client = builder.build().await.unwrap(); + let client = builder.build().await.unwrap(); // Then a client should be built with support for sliding sync. - #[cfg(feature = "experimental-sliding-sync")] assert_matches!( - _client.sliding_sync_version(), + client.sliding_sync_version(), SlidingSyncVersion::Proxy { url } => { assert_eq!(url, Url::parse("https://localhost:1234").unwrap()); } @@ -984,7 +968,6 @@ pub(crate) mod tests { } #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_discovery_well_known_with_sliding_sync_override() { // Given a base server with a well-known file that points to a homeserver with a // sliding sync proxy. @@ -1022,7 +1005,6 @@ pub(crate) mod tests { } #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_sliding_sync_discover_proxy() { // Given a homeserver with a `.well-known` file. let homeserver = make_mock_homeserver().await; @@ -1057,7 +1039,6 @@ pub(crate) mod tests { } #[async_test] - #[cfg(feature = "experimental-sliding-sync")] async fn test_sliding_sync_discover_native() { // Given a homeserver with a `/versions` file. let homeserver = make_mock_homeserver().await; diff --git a/crates/matrix-sdk/src/client/futures.rs b/crates/matrix-sdk/src/client/futures.rs index da5d8d8764b..7c828cc7b48 100644 --- a/crates/matrix-sdk/src/client/futures.rs +++ b/crates/matrix-sdk/src/client/futures.rs @@ -71,7 +71,6 @@ impl SendRequest { /// /// This is useful at the moment because the current sliding sync /// implementation uses a proxy server. - #[cfg(feature = "experimental-sliding-sync")] pub fn with_homeserver_override(mut self, homeserver_override: Option) -> Self { self.homeserver_override = homeserver_override; self diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index c0802de757e..22825062d60 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -79,8 +79,6 @@ use url::Url; use self::futures::SendRequest; #[cfg(feature = "experimental-oidc")] use crate::oidc::Oidc; -#[cfg(feature = "experimental-sliding-sync")] -use crate::sliding_sync::Version as SlidingSyncVersion; use crate::{ authentication::{AuthCtx, AuthData, ReloadSessionCallback, SaveSessionCallback}, config::RequestConfig, @@ -96,6 +94,7 @@ use crate::{ notification_settings::NotificationSettings, room_preview::RoomPreview, send_queue::SendQueueData, + sliding_sync::Version as SlidingSyncVersion, sync::{RoomUpdate, SyncResponse}, Account, AuthApi, AuthSession, Error, Media, Pusher, RefreshTokenError, Result, Room, TransmissionProgress, @@ -258,7 +257,7 @@ pub(crate) struct ClientInner { /// This is the URL for the client-server Matrix API. homeserver: StdRwLock, - #[cfg(feature = "experimental-sliding-sync")] + /// The sliding sync version. sliding_sync_version: StdRwLock, /// The underlying HTTP client. @@ -345,7 +344,7 @@ impl ClientInner { auth_ctx: Arc, server: Option, homeserver: Url, - #[cfg(feature = "experimental-sliding-sync")] sliding_sync_version: SlidingSyncVersion, + sliding_sync_version: SlidingSyncVersion, http_client: HttpClient, base_client: BaseClient, server_capabilities: ClientServerCapabilities, @@ -359,7 +358,6 @@ impl ClientInner { server, homeserver: StdRwLock::new(homeserver), auth_ctx, - #[cfg(feature = "experimental-sliding-sync")] sliding_sync_version: StdRwLock::new(sliding_sync_version), http_client, base_client, @@ -515,13 +513,11 @@ impl Client { } /// Get the sliding sync version. - #[cfg(feature = "experimental-sliding-sync")] pub fn sliding_sync_version(&self) -> SlidingSyncVersion { self.inner.sliding_sync_version.read().unwrap().clone() } /// Override the sliding sync version. - #[cfg(feature = "experimental-sliding-sync")] pub fn set_sliding_sync_version(&self, version: SlidingSyncVersion) { let mut lock = self.inner.sliding_sync_version.write().unwrap(); *lock = version; @@ -2390,7 +2386,6 @@ impl Client { self.inner.auth_ctx.clone(), self.server().cloned(), self.homeserver(), - #[cfg(feature = "experimental-sliding-sync")] self.sliding_sync_version(), self.inner.http_client.clone(), self.inner diff --git a/crates/matrix-sdk/src/error.rs b/crates/matrix-sdk/src/error.rs index 82fe040b845..99658d2fc38 100644 --- a/crates/matrix-sdk/src/error.rs +++ b/crates/matrix-sdk/src/error.rs @@ -338,7 +338,6 @@ pub enum Error { UserTagName(#[from] InvalidUserTagName), /// An error occurred within sliding-sync - #[cfg(feature = "experimental-sliding-sync")] #[error(transparent)] SlidingSync(#[from] crate::sliding_sync::Error), diff --git a/crates/matrix-sdk/src/http_client/mod.rs b/crates/matrix-sdk/src/http_client/mod.rs index 6cc674bf64e..e0944d558e1 100644 --- a/crates/matrix-sdk/src/http_client/mod.rs +++ b/crates/matrix-sdk/src/http_client/mod.rs @@ -208,15 +208,6 @@ impl HttpClient { span.record("request_size", ByteSize(request_size).to_string_as(true)); } - // Since sliding sync is experimental, and the proxy might not do what we expect - // it to do given a specific request body, it's useful to log the - // request body here. This doesn't contain any personal information. - // TODO: Remove this once sliding sync isn't experimental anymore. - #[cfg(feature = "experimental-sliding-sync")] - if type_name::() == "ruma_client_api::sync::sync_events::v4::Request" { - span.record("request_body", debug(request.body())); - } - request }; diff --git a/crates/matrix-sdk/src/lib.rs b/crates/matrix-sdk/src/lib.rs index 6d74698f71a..bfc7a9bc2af 100644 --- a/crates/matrix-sdk/src/lib.rs +++ b/crates/matrix-sdk/src/lib.rs @@ -61,7 +61,6 @@ pub mod futures { pub use super::client::futures::SendRequest; } -#[cfg(feature = "experimental-sliding-sync")] pub mod sliding_sync; pub mod sync; #[cfg(feature = "experimental-widgets")] @@ -85,7 +84,6 @@ pub use media::Media; pub use pusher::Pusher; pub use room::Room; pub use ruma::{IdParseError, OwnedServerName, ServerName}; -#[cfg(feature = "experimental-sliding-sync")] pub use sliding_sync::{ SlidingSync, SlidingSyncBuilder, SlidingSyncList, SlidingSyncListBuilder, SlidingSyncListLoadingState, SlidingSyncMode, SlidingSyncRoom, UpdateSummary, diff --git a/crates/matrix-sdk/src/sliding_sync/cache.rs b/crates/matrix-sdk/src/sliding_sync/cache.rs index 27b906b153b..22f52f27b15 100644 --- a/crates/matrix-sdk/src/sliding_sync/cache.rs +++ b/crates/matrix-sdk/src/sliding_sync/cache.rs @@ -75,7 +75,7 @@ async fn clean_storage( /// Store the `SlidingSync`'s state in the storage. pub(super) async fn store_sliding_sync_state( sliding_sync: &SlidingSync, - position: &SlidingSyncPositionMarkers, + _position: &SlidingSyncPositionMarkers, ) -> Result<()> { let storage_key = &sliding_sync.inner.storage_key; let instance_storage_key = format_storage_key_for_sliding_sync(storage_key); @@ -94,6 +94,8 @@ pub(super) async fn store_sliding_sync_state( #[cfg(feature = "e2e-encryption")] { + let position = _position; + // FIXME (TERRIBLE HACK): we want to save `pos` in a cross-process safe manner, // with both processes sharing the same database backend; that needs to // go in the crypto process store at the moment, but should be fixed diff --git a/crates/matrix-sdk/tests/integration/encryption/backups.rs b/crates/matrix-sdk/tests/integration/encryption/backups.rs index 6a335763ac4..5f41f1e3929 100644 --- a/crates/matrix-sdk/tests/integration/encryption/backups.rs +++ b/crates/matrix-sdk/tests/integration/encryption/backups.rs @@ -714,7 +714,6 @@ async fn test_incremental_upload_of_keys() -> Result<()> { } #[async_test] -#[cfg(feature = "experimental-sliding-sync")] async fn test_incremental_upload_of_keys_sliding_sync() -> Result<()> { use tokio::task::spawn_blocking; diff --git a/crates/matrix-sdk/tests/integration/room_preview.rs b/crates/matrix-sdk/tests/integration/room_preview.rs index 71d2dcb8d7a..39fd06a2f23 100644 --- a/crates/matrix-sdk/tests/integration/room_preview.rs +++ b/crates/matrix-sdk/tests/integration/room_preview.rs @@ -1,15 +1,14 @@ -#[cfg(feature = "experimental-sliding-sync")] use js_int::uint; use matrix_sdk::{config::SyncSettings, test_utils::logged_in_client_with_server}; -#[cfg(feature = "experimental-sliding-sync")] -use matrix_sdk_base::sliding_sync; -use matrix_sdk_base::RoomState; +use matrix_sdk_base::{sliding_sync, RoomState}; use matrix_sdk_test::{ async_test, InvitedRoomBuilder, JoinedRoomBuilder, KnockedRoomBuilder, SyncResponseBuilder, }; -#[cfg(feature = "experimental-sliding-sync")] -use ruma::{api::client::sync::sync_events::v5::response::Hero, assign, owned_user_id}; -use ruma::{events::room::member::MembershipState, room_id, space::SpaceRoomJoinRule, RoomId}; +use ruma::{ + api::client::sync::sync_events::v5::response::Hero, assign, + events::room::member::MembershipState, owned_user_id, room_id, space::SpaceRoomJoinRule, + RoomId, +}; use serde_json::json; use wiremock::{ matchers::{header, method, path_regex}, @@ -115,7 +114,6 @@ async fn test_room_preview_leave_unknown_room_fails() { assert!(client.get_room(room_id).is_none()); } -#[cfg(feature = "experimental-sliding-sync")] #[async_test] async fn test_room_preview_computes_name_if_room_is_known() { let (client, _) = logged_in_client_with_server().await; diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 05ea8695996..f961d390071 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -193,7 +193,7 @@ fn check_clippy() -> Result<()> { "rustup run {NIGHTLY} cargo clippy --workspace --all-targets --exclude matrix-sdk-crypto --exclude xtask --no-default-features - --features native-tls,experimental-sliding-sync,sso-login,testing + --features native-tls,sso-login,testing -- -D warnings" ) .run()?; @@ -214,10 +214,7 @@ fn check_docs() -> Result<()> { fn run_feature_tests(cmd: Option) -> Result<()> { let args = BTreeMap::from([ - ( - FeatureSet::NoEncryption, - "--no-default-features --features sqlite,native-tls,experimental-sliding-sync,testing", - ), + (FeatureSet::NoEncryption, "--no-default-features --features sqlite,native-tls,testing"), ( FeatureSet::NoSqlite, "--no-default-features --features e2e-encryption,native-tls,testing",