From 9b07772d1a4fffe820ebbce1b8271a183f9e27df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 12 Nov 2023 14:13:27 +0100 Subject: [PATCH] push: Allow to deserialize (New)ConditionalPushRule without conditions --- crates/ruma-common/CHANGELOG.md | 4 ++++ crates/ruma-common/src/push.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index fbe01ccf..b5c7ab0d 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -1,5 +1,9 @@ # [unreleased] +Bug fixes: + +- Allow to deserialize `(New)ConditionalPushRule` with a missing `conditions` field. + # 0.12.0 Bug fixes: diff --git a/crates/ruma-common/src/push.rs b/crates/ruma-common/src/push.rs index f497834e..3c0fd31f 100644 --- a/crates/ruma-common/src/push.rs +++ b/crates/ruma-common/src/push.rs @@ -466,6 +466,7 @@ pub struct ConditionalPushRule { /// event. /// /// A rule with no conditions always matches. + #[serde(default)] pub conditions: Vec, } @@ -870,6 +871,7 @@ pub struct NewConditionalPushRule { /// event. /// /// A rule with no conditions always matches. + #[serde(default)] pub conditions: Vec, /// Actions to determine if and how a notification is delivered for events matching this