From 9e74a425dd8c1a44a05cf07b4d19c151d5954c67 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 26 Sep 2022 11:20:01 +0200 Subject: [PATCH] Always send default and rule_id to clients Spec marks those as required fields and clients rely on it. Broken in 1.66. Fixes #13837 Signed-off-by: Nicolas Werner --- synapse/push/clientformat.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/synapse/push/clientformat.py b/synapse/push/clientformat.py index ebc13beda1bc..7095ae83f931 100644 --- a/synapse/push/clientformat.py +++ b/synapse/push/clientformat.py @@ -102,10 +102,8 @@ def _rule_to_template(rule: PushRule) -> Optional[Dict[str, Any]]: # with PRIORITY_CLASS_INVERSE_MAP. raise ValueError("Unexpected template_name: %s" % (template_name,)) - if unscoped_rule_id: - templaterule["rule_id"] = unscoped_rule_id - if rule.default: - templaterule["default"] = True + templaterule["rule_id"] = unscoped_rule_id + templaterule["default"] = rule.default return templaterule