mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 16:04:58 -04:00
Use the proper serialization format when bundling aggregations. (#12090)
This ensures that the `latest_event` field of the bundled aggregation for threads uses the same format as the other events in the response.
This commit is contained in:
parent
a511a890d7
commit
1d11b452b7
10 changed files with 130 additions and 143 deletions
|
@ -22,6 +22,7 @@ from twisted.python.failure import Failure
|
|||
from synapse.api.constants import EventTypes, Membership
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.api.filtering import Filter
|
||||
from synapse.events.utils import SerializeEventConfig
|
||||
from synapse.handlers.room import ShutdownRoomResponse
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.storage.state import StateFilter
|
||||
|
@ -541,13 +542,15 @@ class PaginationHandler:
|
|||
|
||||
time_now = self.clock.time_msec()
|
||||
|
||||
serialize_options = SerializeEventConfig(as_client_event=as_client_event)
|
||||
|
||||
chunk = {
|
||||
"chunk": (
|
||||
self._event_serializer.serialize_events(
|
||||
events,
|
||||
time_now,
|
||||
config=serialize_options,
|
||||
bundle_aggregations=aggregations,
|
||||
as_client_event=as_client_event,
|
||||
)
|
||||
),
|
||||
"start": await from_token.to_string(self.store),
|
||||
|
@ -556,7 +559,7 @@ class PaginationHandler:
|
|||
|
||||
if state:
|
||||
chunk["state"] = self._event_serializer.serialize_events(
|
||||
state, time_now, as_client_event=as_client_event
|
||||
state, time_now, config=serialize_options
|
||||
)
|
||||
|
||||
return chunk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue