summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-01-13 10:45:28 -0500
committerGitHub <noreply@github.com>2022-01-13 10:45:28 -0500
commit0c40c619aa8c8240ab75970e195fe73695df978b (patch)
treeea03bc33f7e565d991315efbc9e3bfed49109712 /synapse/rest/client
parentSimplify GC prometheus metrics (#11723) (diff)
downloadsynapse-0c40c619aa8c8240ab75970e195fe73695df978b.tar.xz
Include bundled aggregations in the sync response cache. (#11659)
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/sync.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/synapse/rest/client/sync.py b/synapse/rest/client/sync.py
index a3e57e4b20..d20ae1421e 100644
--- a/synapse/rest/client/sync.py
+++ b/synapse/rest/client/sync.py
@@ -554,20 +554,9 @@ class SyncRestServlet(RestServlet):
                 )
 
         serialized_state = serialize(state_events)
-        # Don't bother to bundle aggregations if the timeline is unlimited,
-        # as clients will have all the necessary information.
-        # bundle_aggregations=room.timeline.limited,
-        #
-        # richvdh 2021-12-15: disable this temporarily as it has too high an
-        # overhead for initialsyncs. We need to figure out a way that the
-        # bundling can be done *before* the events are stored in the
-        # SyncResponseCache so that this part can be synchronous.
-        #
-        # Ensure to re-enable the test at tests/rest/client/test_relations.py::RelationsTestCase.test_bundled_aggregations.
-        # if room.timeline.limited:
-        #    aggregations = await self.store.get_bundled_aggregations(timeline_events)
-        aggregations = None
-        serialized_timeline = serialize(timeline_events, aggregations)
+        serialized_timeline = serialize(
+            timeline_events, room.timeline.bundled_aggregations
+        )
 
         account_data = room.account_data