Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 1b0eaed

Browse files
Prevent bundling aggregations for state events (#9619)
There's no need to do aggregation bundling for state events. Doing so can cause performance issues.
1 parent 1c8a254 commit 1b0eaed

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

changelog.d/9619.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Prevent attempting to bundle aggregations for state events in /context APIs.

synapse/rest/admin/rooms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,10 @@ async def on_GET(
685685
results["events_after"], time_now
686686
)
687687
results["state"] = await self._event_serializer.serialize_events(
688-
results["state"], time_now
688+
results["state"],
689+
time_now,
690+
# No need to bundle aggregations for state events
691+
bundle_aggregations=False,
689692
)
690693

691694
return 200, results

synapse/rest/client/v1/room.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,10 @@ async def on_GET(self, request, room_id, event_id):
671671
results["events_after"], time_now
672672
)
673673
results["state"] = await self._event_serializer.serialize_events(
674-
results["state"], time_now
674+
results["state"],
675+
time_now,
676+
# No need to bundle aggregations for state events
677+
bundle_aggregations=False,
675678
)
676679

677680
return 200, results

0 commit comments

Comments
 (0)