summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2022-03-16 12:22:07 -0400
committerPatrick Cloke <patrickc@matrix.org>2022-03-16 12:22:07 -0400
commit3f7cfbc9e5e82d17cd7782adcbe78e239aae5691 (patch)
tree35aaeba932f2ab5bd614ab9a946fe7967b6fca3e /synapse/events/utils.py
parentHandle cancellation in `DatabasePool.runInteraction()` (#12199) (diff)
parentRe-generate changelog. (diff)
downloadsynapse-3f7cfbc9e5e82d17cd7782adcbe78e239aae5691.tar.xz
Merge branch 'release-v1.55' into develop
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index b2a237c1e0..a0520068e0 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -530,9 +530,12 @@ class EventClientSerializer:
 
         # Include the bundled aggregations in the event.
         if serialized_aggregations:
-            serialized_event["unsigned"].setdefault("m.relations", {}).update(
-                serialized_aggregations
-            )
+            # There is likely already an "unsigned" field, but a filter might
+            # have stripped it off (via the event_fields option). The server is
+            # allowed to return additional fields, so add it back.
+            serialized_event.setdefault("unsigned", {}).setdefault(
+                "m.relations", {}
+            ).update(serialized_aggregations)
 
     def serialize_events(
         self,