From dd686f41adc422948e300a15be314b6ee9c1b243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 17 Jul 2025 10:01:09 +0200 Subject: [PATCH 1/3] refactor(base): Remove the event_id field of PredecessorRoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is going away in MSC4291, which should be accepted next week. Removing it now makes sure that no one uses it. Signed-off-by: Kévin Commaille --- bindings/matrix-sdk-ffi/src/room/mod.rs | 5 +---- crates/matrix-sdk-base/src/room/tombstone.rs | 15 ++++----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/room/mod.rs b/bindings/matrix-sdk-ffi/src/room/mod.rs index ab6aa80f79a..a22909f6b4a 100644 --- a/bindings/matrix-sdk-ffi/src/room/mod.rs +++ b/bindings/matrix-sdk-ffi/src/room/mod.rs @@ -1504,13 +1504,10 @@ impl From for SuccessorRoom { pub struct PredecessorRoom { /// The ID of the replacement room. pub room_id: String, - - /// The event ID of the last known event in the predecesssor room. - pub last_event_id: String, } impl From for PredecessorRoom { fn from(value: SdkPredecessorRoom) -> Self { - Self { room_id: value.room_id.to_string(), last_event_id: value.last_event_id.to_string() } + Self { room_id: value.room_id.to_string() } } } diff --git a/crates/matrix-sdk-base/src/room/tombstone.rs b/crates/matrix-sdk-base/src/room/tombstone.rs index 0a333685361..c285bf2a5aa 100644 --- a/crates/matrix-sdk-base/src/room/tombstone.rs +++ b/crates/matrix-sdk-base/src/room/tombstone.rs @@ -14,7 +14,7 @@ use std::ops::Not; -use ruma::{events::room::tombstone::RoomTombstoneEventContent, OwnedEventId, OwnedRoomId}; +use ruma::{events::room::tombstone::RoomTombstoneEventContent, OwnedRoomId}; use super::Room; @@ -67,12 +67,9 @@ impl Room { /// [`m.room.tombstone`]: https://spec.matrix.org/v1.14/client-server-api/#mroomtombstone /// [`m.room.create`]: https://spec.matrix.org/v1.14/client-server-api/#mroomcreate pub fn predecessor_room(&self) -> Option { - self.create_content().and_then(|content_event| content_event.predecessor).map( - |predecessor| PredecessorRoom { - room_id: predecessor.room_id, - last_event_id: predecessor.event_id, - }, - ) + self.create_content() + .and_then(|content_event| content_event.predecessor) + .map(|predecessor| PredecessorRoom { room_id: predecessor.room_id }) } } @@ -104,9 +101,6 @@ pub struct SuccessorRoom { pub struct PredecessorRoom { /// The ID of the old room. pub room_id: OwnedRoomId, - - /// The event ID of the last known event in the predecesssor room. - pub last_event_id: OwnedEventId, } #[cfg(test)] @@ -252,7 +246,6 @@ mod tests { assert!(room.create_content().is_some()); assert_matches!(room.predecessor_room(), Some(predecessor_room) => { assert_eq!(predecessor_room.room_id, predecessor_room_id); - assert_eq!(predecessor_room.last_event_id, predecessor_last_event_id); }); } } From 313017e27980066d57eccb7ea2022e7da3d78d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 17 Jul 2025 10:05:53 +0200 Subject: [PATCH 2/3] Add changelogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- bindings/matrix-sdk-ffi/CHANGELOG.md | 3 +++ crates/matrix-sdk-base/CHANGELOG.md | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index 664ac6fdd22..df2e3e93839 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -15,6 +15,9 @@ All notable changes to this project will be documented in this file. - `ClientBuilder::build_with_qr_code` has been removed. Instead, the Client should be built by passing `QrCodeData::server_name` to `ClientBuilder::server_name_or_homeserver_url`, after which QR login can be performed by calling `Client::login_with_qr_code`. ([#5388](https://github.com/matrix-org/matrix-rust-sdk/pull/5388)) +- The `event_id` field of `PredecessorRoom` was removed, due to its removal in the Matrix + specification with MSC4291. + ([#5419](https://github.com/matrix-org/matrix-rust-sdk/pull/5419)) ## [0.13.0] - 2025-07-10 diff --git a/crates/matrix-sdk-base/CHANGELOG.md b/crates/matrix-sdk-base/CHANGELOG.md index 35e3964e78a..b1232f81971 100644 --- a/crates/matrix-sdk-base/CHANGELOG.md +++ b/crates/matrix-sdk-base/CHANGELOG.md @@ -15,6 +15,11 @@ All notable changes to this project will be documented in this file. inviter. ([#5390](https://github.com/matrix-org/matrix-rust-sdk/pull/5390)) +### Refactor +- [**breaking**] The `event_id` field of `PredecessorRoom` was removed, due to + its removal in the Matrix specification with MSC4291. + ([#5419](https://github.com/matrix-org/matrix-rust-sdk/pull/5419)) + ## [0.13.0] - 2025-07-10 ### Features @@ -59,8 +64,8 @@ No notable changes in this release. - `EventCacheStoreMedia` has a new method `last_media_cleanup_time_inner` - There are new `'static` bounds in `MediaService` for the media cache stores - `event_cache::store::MemoryStore` implements `Clone`. -- `BaseClient` now has a `handle_verification_events` field which is `true` by - default and can be negated so the `NotificationClient` won't handle received +- `BaseClient` now has a `handle_verification_events` field which is `true` by + default and can be negated so the `NotificationClient` won't handle received verification events too, causing errors in the `VerificationMachine`. - [**breaking**] `Room::is_encryption_state_synced` has been removed ([#4777](https://github.com/matrix-org/matrix-rust-sdk/pull/4777)) From 96e20ba765c9c4dbf9a59d9b5d7e2d99db616a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 17 Jul 2025 12:29:58 +0200 Subject: [PATCH 3/3] Move changelog entry to the top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- bindings/matrix-sdk-ffi/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index df2e3e93839..96f77b27651 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. ### Breaking changes: +- The `event_id` field of `PredecessorRoom` was removed, due to its removal in the Matrix + specification with MSC4291. + ([#5419](https://github.com/matrix-org/matrix-rust-sdk/pull/5419)) - `Client::url_for_oidc` now allows requesting additional scopes for the OAuth2 authorization code grant. ([#5395](https://github.com/matrix-org/matrix-rust-sdk/pull/5395)) - `Client::url_for_oidc` now allows passing an optional existing device id from a previous login call. @@ -15,9 +18,6 @@ All notable changes to this project will be documented in this file. - `ClientBuilder::build_with_qr_code` has been removed. Instead, the Client should be built by passing `QrCodeData::server_name` to `ClientBuilder::server_name_or_homeserver_url`, after which QR login can be performed by calling `Client::login_with_qr_code`. ([#5388](https://github.com/matrix-org/matrix-rust-sdk/pull/5388)) -- The `event_id` field of `PredecessorRoom` was removed, due to its removal in the Matrix - specification with MSC4291. - ([#5419](https://github.com/matrix-org/matrix-rust-sdk/pull/5419)) ## [0.13.0] - 2025-07-10