Skip to content
Snippets Groups Projects
Commit 8e4083e2 authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

Merge remote-tracking branch 'origin/release-v1.49' into develop

parents 3e0cfd44 76aa5537
No related branches found
No related tags found
No related merge requests found
Fix a performance regression in `/sync` handling, introduced in 1.49.0.
...@@ -525,7 +525,15 @@ class SyncRestServlet(RestServlet): ...@@ -525,7 +525,15 @@ class SyncRestServlet(RestServlet):
time_now=time_now, time_now=time_now,
# Don't bother to bundle aggregations if the timeline is unlimited, # Don't bother to bundle aggregations if the timeline is unlimited,
# as clients will have all the necessary information. # as clients will have all the necessary information.
bundle_aggregations=room.timeline.limited, # 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.
bundle_aggregations=False,
token_id=token_id, token_id=token_id,
event_format=event_formatter, event_format=event_formatter,
only_event_fields=only_fields, only_event_fields=only_fields,
......
...@@ -577,11 +577,11 @@ class RelationsTestCase(unittest.HomeserverTestCase): ...@@ -577,11 +577,11 @@ class RelationsTestCase(unittest.HomeserverTestCase):
assert_bundle(channel.json_body["event"]["unsigned"].get("m.relations")) assert_bundle(channel.json_body["event"]["unsigned"].get("m.relations"))
# Request sync. # Request sync.
channel = self.make_request("GET", "/sync", access_token=self.user_token) # channel = self.make_request("GET", "/sync", access_token=self.user_token)
self.assertEquals(200, channel.code, channel.json_body) # self.assertEquals(200, channel.code, channel.json_body)
room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"] # room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"]
self.assertTrue(room_timeline["limited"]) # self.assertTrue(room_timeline["limited"])
_find_and_assert_event(room_timeline["events"]) # _find_and_assert_event(room_timeline["events"])
# Note that /relations is tested separately in test_aggregation_get_event_for_thread # Note that /relations is tested separately in test_aggregation_get_event_for_thread
# since it needs different data configured. # since it needs different data configured.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment