mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 09:35:45 +03:00
Don't bundle aggregations when retrieving the original event (#5654)
A fix for PR #5626, which returned the original event content as part of a call to /relations. Only problem was that we were attempting to aggregate the relations on top of it when we did so. We now set bundle_aggregations to False in the get_event call. We also do this when pulling the relation events as well, because edits of edits are not something we'd like to support here.
This commit is contained in:
parent
3dd61d12cd
commit
f281714583
2 changed files with 13 additions and 2 deletions
1
changelog.d/5654.bugfix
Normal file
1
changelog.d/5654.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix bug in #5626 that prevented the original_event field from actually having the contents of the original event in a call to `/relations`.
|
|
@ -173,8 +173,18 @@ class RelationPaginationServlet(RestServlet):
|
|||
)
|
||||
|
||||
now = self.clock.time_msec()
|
||||
original_event = yield self._event_serializer.serialize_event(event, now)
|
||||
events = yield self._event_serializer.serialize_events(events, now)
|
||||
# We set bundle_aggregations to False when retrieving the original
|
||||
# event because we want the content before relations were applied to
|
||||
# it.
|
||||
original_event = yield self._event_serializer.serialize_event(
|
||||
event, now, bundle_aggregations=False
|
||||
)
|
||||
# Similarly, we don't allow relations to be applied to relations, so we
|
||||
# return the original relations without any aggregations on top of them
|
||||
# here.
|
||||
events = yield self._event_serializer.serialize_events(
|
||||
events, now, bundle_aggregations=False
|
||||
)
|
||||
|
||||
return_value = result.to_dict()
|
||||
return_value["chunk"] = events
|
||||
|
|
Loading…
Reference in a new issue