diff --git a/changelog.d/9619.misc b/changelog.d/9619.misc new file mode 100644 index 0000000000000000000000000000000000000000..50267bfbc472e1bbfb038c2d9bd717ea78a5faff --- /dev/null +++ b/changelog.d/9619.misc @@ -0,0 +1 @@ +Prevent attempting to bundle aggregations for state events in /context APIs. \ No newline at end of file diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index f2c42a0f30a40f158f4621be4814014eb615301d..263d8ec07619a362afcff29fab0dd8d5a0185132 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -685,7 +685,10 @@ class RoomEventContextServlet(RestServlet): results["events_after"], time_now ) results["state"] = await self._event_serializer.serialize_events( - results["state"], time_now + results["state"], + time_now, + # No need to bundle aggregations for state events + bundle_aggregations=False, ) return 200, results diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py index 9a1df30c2999e32d611063b1e752c769659228ad..5884daea6da22e73f0dd42c933920d81f67548a4 100644 --- a/synapse/rest/client/v1/room.py +++ b/synapse/rest/client/v1/room.py @@ -671,7 +671,10 @@ class RoomEventContextServlet(RestServlet): results["events_after"], time_now ) results["state"] = await self._event_serializer.serialize_events( - results["state"], time_now + results["state"], + time_now, + # No need to bundle aggregations for state events + bundle_aggregations=False, ) return 200, results