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

Commit

Permalink
Consistently do not bundle aggregations for state events.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Dec 1, 2021
1 parent 4a1e921 commit d599b05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion synapse/handlers/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,11 @@ async def get_messages(

if state:
chunk["state"] = await self._event_serializer.serialize_events(
state, time_now, as_client_event=as_client_event
state,
time_now,
as_client_event=as_client_event,
# No need to bundle aggregations for state events.
bundle_aggregations=False,
)

return chunk
Expand Down
3 changes: 2 additions & 1 deletion synapse/handlers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ async def search(
if state_results:
s = {}
for room_id, state_events in state_results.items():
# No need to bundle aggregations for state events.
s[room_id] = await self._event_serializer.serialize_events(
state_events, time_now
state_events, time_now, bundle_aggregations=False
)

rooms_cat_res["state"] = s
Expand Down
4 changes: 4 additions & 0 deletions synapse/rest/client/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ async def encode_invited(
invite = await self._event_serializer.serialize_event(
room.invite,
time_now,
# No need to bundle aggregations for state events.
bundle_aggregations=False,
token_id=token_id,
event_format=event_formatter,
include_stripped_room_state=True,
Expand Down Expand Up @@ -427,6 +429,8 @@ async def encode_knocked(
knock = await self._event_serializer.serialize_event(
room.knock,
time_now,
# No need to bundle aggregations for state events.
bundle_aggregations=False,
token_id=token_id,
event_format=event_formatter,
include_stripped_room_state=True,
Expand Down

0 comments on commit d599b05

Please sign in to comment.