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

Commit

Permalink
Prevent bundling aggregations for state events (#9619)
Browse files Browse the repository at this point in the history
There's no need to do aggregation bundling for state events. Doing so can cause performance issues.
  • Loading branch information
anoadragon453 committed Mar 16, 2021
1 parent 1c8a254 commit 1b0eaed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/9619.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevent attempting to bundle aggregations for state events in /context APIs.
5 changes: 4 additions & 1 deletion synapse/rest/admin/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,10 @@ async def on_GET(
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
5 changes: 4 additions & 1 deletion synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ async def on_GET(self, request, room_id, event_id):
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
Expand Down

0 comments on commit 1b0eaed

Please sign in to comment.