From e30360dd4c98c9eafc2332a4b914072493b98eec Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 16 Nov 2023 10:28:49 +0100 Subject: [PATCH 1/4] client-api: Fix deserialization of `claim_keys` responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … without a `failures` field. --- crates/ruma-client-api/CHANGELOG.md | 4 ++++ crates/ruma-client-api/src/keys/claim_keys/v3.rs | 1 + crates/ruma-client-api/src/keys/claim_keys/v4.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index bc19e643..03263b00 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -1,5 +1,9 @@ # [unreleased] +Bug fixes: + +- Fix deserialization of `claim_keys` responses without a `failures` field + # 0.17.2 Improvements: diff --git a/crates/ruma-client-api/src/keys/claim_keys/v3.rs b/crates/ruma-client-api/src/keys/claim_keys/v3.rs index bd063f55..5d4faa2f 100644 --- a/crates/ruma-client-api/src/keys/claim_keys/v3.rs +++ b/crates/ruma-client-api/src/keys/claim_keys/v3.rs @@ -44,6 +44,7 @@ pub struct Request { pub struct Response { /// If any remote homeservers could not be reached, they are recorded here. /// The names of the properties are the names of the unreachable servers. + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub failures: BTreeMap, /// One-time keys for the queried devices. diff --git a/crates/ruma-client-api/src/keys/claim_keys/v4.rs b/crates/ruma-client-api/src/keys/claim_keys/v4.rs index ef7948f7..4fd9b100 100644 --- a/crates/ruma-client-api/src/keys/claim_keys/v4.rs +++ b/crates/ruma-client-api/src/keys/claim_keys/v4.rs @@ -43,6 +43,7 @@ pub struct Request { pub struct Response { /// If any remote homeservers could not be reached, they are recorded here. /// The names of the properties are the names of the unreachable servers. + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub failures: BTreeMap, /// One-time keys for the queried devices. From 4189dde59e5b872ff19a23699467bfb0ae6d0490 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 16 Nov 2023 10:30:34 +0100 Subject: [PATCH 2/4] client-api: Separate docstring into two paragraphs --- crates/ruma-client-api/src/keys/claim_keys/v3.rs | 1 + crates/ruma-client-api/src/keys/claim_keys/v4.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/ruma-client-api/src/keys/claim_keys/v3.rs b/crates/ruma-client-api/src/keys/claim_keys/v3.rs index 5d4faa2f..38b6824f 100644 --- a/crates/ruma-client-api/src/keys/claim_keys/v3.rs +++ b/crates/ruma-client-api/src/keys/claim_keys/v3.rs @@ -43,6 +43,7 @@ pub struct Request { #[response(error = crate::Error)] pub struct Response { /// If any remote homeservers could not be reached, they are recorded here. + /// /// The names of the properties are the names of the unreachable servers. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub failures: BTreeMap, diff --git a/crates/ruma-client-api/src/keys/claim_keys/v4.rs b/crates/ruma-client-api/src/keys/claim_keys/v4.rs index 4fd9b100..a111741c 100644 --- a/crates/ruma-client-api/src/keys/claim_keys/v4.rs +++ b/crates/ruma-client-api/src/keys/claim_keys/v4.rs @@ -42,6 +42,7 @@ pub struct Request { #[response(error = crate::Error)] pub struct Response { /// If any remote homeservers could not be reached, they are recorded here. + /// /// The names of the properties are the names of the unreachable servers. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub failures: BTreeMap, From 5d7c1f53308782841d428265fa021123f516dcba Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 16 Nov 2023 10:43:15 +0100 Subject: [PATCH 3/4] Release ruma-common 0.12.1 --- Cargo.toml | 2 +- crates/ruma-common/CHANGELOG.md | 2 ++ crates/ruma-common/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5ee46c7d..d0b93cc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ http = "0.2.8" js_int = "0.2.2" maplit = "1.0.2" ruma-appservice-api = { version = "0.9.0", path = "crates/ruma-appservice-api" } -ruma-common = { version = "0.12.0", path = "crates/ruma-common" } +ruma-common = { version = "0.12.1", path = "crates/ruma-common" } ruma-client = { version = "0.12.0", path = "crates/ruma-client" } ruma-client-api = { version = "0.17.2", path = "crates/ruma-client-api" } ruma-events = { version = "0.27.9", path = "crates/ruma-events" } diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index b5c7ab0d..fd9c1134 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -1,5 +1,7 @@ # [unreleased] +# 0.12.1 + Bug fixes: - Allow to deserialize `(New)ConditionalPushRule` with a missing `conditions` field. diff --git a/crates/ruma-common/Cargo.toml b/crates/ruma-common/Cargo.toml index 5d1537a2..b6a18af0 100644 --- a/crates/ruma-common/Cargo.toml +++ b/crates/ruma-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruma-common" -version = "0.12.0" +version = "0.12.1" description = "Common types for other ruma crates." homepage = "https://ruma.io/" keywords = ["matrix", "chat", "messaging", "ruma"] From 8d050d78301cbc38908c2a30db90deee7ed1b608 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 16 Nov 2023 10:44:28 +0100 Subject: [PATCH 4/4] Release ruma-client-api 0.17.3 --- Cargo.toml | 2 +- crates/ruma-client-api/CHANGELOG.md | 2 ++ crates/ruma-client-api/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d0b93cc3..47e3db97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ maplit = "1.0.2" ruma-appservice-api = { version = "0.9.0", path = "crates/ruma-appservice-api" } ruma-common = { version = "0.12.1", path = "crates/ruma-common" } ruma-client = { version = "0.12.0", path = "crates/ruma-client" } -ruma-client-api = { version = "0.17.2", path = "crates/ruma-client-api" } +ruma-client-api = { version = "0.17.3", path = "crates/ruma-client-api" } ruma-events = { version = "0.27.9", path = "crates/ruma-events" } ruma-federation-api = { version = "0.8.0", path = "crates/ruma-federation-api" } ruma-html = { version = "0.1.0", path = "crates/ruma-html" } diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index 03263b00..807109e5 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -1,5 +1,7 @@ # [unreleased] +# 0.17.3 + Bug fixes: - Fix deserialization of `claim_keys` responses without a `failures` field diff --git a/crates/ruma-client-api/Cargo.toml b/crates/ruma-client-api/Cargo.toml index 3e522b0c..41e1f47a 100644 --- a/crates/ruma-client-api/Cargo.toml +++ b/crates/ruma-client-api/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" name = "ruma-client-api" readme = "README.md" repository = "https://github.com/ruma/ruma" -version = "0.17.2" +version = "0.17.3" edition = "2021" rust-version = { workspace = true }