From 426a93f07c1506c516c573a9b2541a92cbb5c22d Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 17 May 2022 10:08:42 +0200 Subject: [PATCH 1/3] docs(crypto): Remove outdated documentation and use auto-link. --- crates/matrix-sdk-crypto/src/machine.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crates/matrix-sdk-crypto/src/machine.rs b/crates/matrix-sdk-crypto/src/machine.rs index 0d5ee4bd0..9540cf1c0 100644 --- a/crates/matrix-sdk-crypto/src/machine.rs +++ b/crates/matrix-sdk-crypto/src/machine.rs @@ -638,11 +638,6 @@ impl OlmMachine { /// Beware that a group session needs to be shared before this method can be /// called using the [`share_group_session`] method. /// - /// Since group sessions can expire or become invalid if the room membership - /// changes client authors should check with the - /// [`should_share_group_session`] method if a new group session needs to - /// be shared. - /// /// # Arguments /// /// * `room_id` - The id of the room for which the message should be @@ -654,9 +649,6 @@ impl OlmMachine { /// # Panics /// /// Panics if a group session for the given room wasn't shared beforehand. - /// - /// [`should_share_group_session`]: #method.should_share_group_session - /// [`share_group_session`]: #method.share_group_session pub async fn encrypt( &self, room_id: &RoomId, From 5f92113627ace7a871e0384322cf17d1006ea802 Mon Sep 17 00:00:00 2001 From: Johannes Becker <66059836+johannescpk@users.noreply.github.com> Date: Tue, 17 May 2022 10:24:28 +0200 Subject: [PATCH 2/3] chore: Use resolver2 for workspace --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 795fafab0..6597b0d88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,5 @@ members = ["benchmarks", "crates/*", "labs/*", "xtask"] # xtask and labs should only be compiled when invoked explicitly default-members = ["benchmarks", "crates/*"] + +resolver = "2" From 248fff370ab3778042aee63bc63a7acdcd0cb9bf Mon Sep 17 00:00:00 2001 From: Amanda Graven Date: Mon, 16 May 2022 10:04:10 +0200 Subject: [PATCH 3/3] test(base): Remove invalid sync event from json The test json used for mocking a sync response contained an ill-formed event with a room_id key present in the event. Since the deserialization ignores the room_id key, this resulted in the client's membership state evaluating to left going by the contents of the state events, despite the room being in the "joined" section of the sync response. This is a violation of the spec. --- crates/matrix-sdk-test/src/test_json/sync.rs | 24 -------------------- crates/matrix-sdk/src/client/mod.rs | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/crates/matrix-sdk-test/src/test_json/sync.rs b/crates/matrix-sdk-test/src/test_json/sync.rs index 842f6ac01..265534359 100644 --- a/crates/matrix-sdk-test/src/test_json/sync.rs +++ b/crates/matrix-sdk-test/src/test_json/sync.rs @@ -210,30 +210,6 @@ pub static SYNC: Lazy = Lazy::new(|| { "replaces_state": "$152034819067QWJxM:localhost" } }, - { - "content": { - "membership": "leave", - "reason": "offline", - "avatar_url": "mxc://avatar.com/d0dV9jLpe", - "displayname": "example" - }, - "event_id": "$1585345508297748AIUBh:matrix.org", - "origin_server_ts": 158534550, - "sender": "@example:localhost", - "state_key": "@example:localhost", - "type": "m.room.member", - "unsigned": { - "replaces_state": "$1585345354296486IGZfp:localhost", - "prev_content": { - "avatar_url": "mxc://avatar.com/d0dV9jLpe", - "displayname": "example", - "membership": "join" - }, - "prev_sender": "@example2:localhost", - "age": 6992 - }, - "room_id": "!roomid:room.com" - } ] }, "timeline": { diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 06125ad5d..4fd1a8fe9 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -3362,7 +3362,7 @@ pub(crate) mod tests { let room = client.get_joined_room(room_id!("!SVkFJHzfwvuaIEawgC:localhost")).unwrap(); let members: Vec = room.active_members().await.unwrap(); - assert_eq!(1, members.len()); + assert_eq!(2, members.len()); // assert!(room.power_levels.is_some()) }