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

Commit 8e4083e

Browse files
committed
Merge remote-tracking branch 'origin/release-v1.49' into develop
2 parents 3e0cfd4 + 76aa553 commit 8e4083e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Diff for: changelog.d/11583.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a performance regression in `/sync` handling, introduced in 1.49.0.

Diff for: synapse/rest/client/sync.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,15 @@ def serialize(events: Iterable[EventBase]) -> Awaitable[List[JsonDict]]:
525525
time_now=time_now,
526526
# Don't bother to bundle aggregations if the timeline is unlimited,
527527
# as clients will have all the necessary information.
528-
bundle_aggregations=room.timeline.limited,
528+
# bundle_aggregations=room.timeline.limited,
529+
#
530+
# richvdh 2021-12-15: disable this temporarily as it has too high an
531+
# overhead for initialsyncs. We need to figure out a way that the
532+
# bundling can be done *before* the events are stored in the
533+
# SyncResponseCache so that this part can be synchronous.
534+
#
535+
# Ensure to re-enable the test at tests/rest/client/test_relations.py::RelationsTestCase.test_bundled_aggregations.
536+
bundle_aggregations=False,
529537
token_id=token_id,
530538
event_format=event_formatter,
531539
only_event_fields=only_fields,

Diff for: tests/rest/client/test_relations.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,11 @@ def _find_and_assert_event(events):
577577
assert_bundle(channel.json_body["event"]["unsigned"].get("m.relations"))
578578

579579
# Request sync.
580-
channel = self.make_request("GET", "/sync", access_token=self.user_token)
581-
self.assertEquals(200, channel.code, channel.json_body)
582-
room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"]
583-
self.assertTrue(room_timeline["limited"])
584-
_find_and_assert_event(room_timeline["events"])
580+
# channel = self.make_request("GET", "/sync", access_token=self.user_token)
581+
# self.assertEquals(200, channel.code, channel.json_body)
582+
# room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"]
583+
# self.assertTrue(room_timeline["limited"])
584+
# _find_and_assert_event(room_timeline["events"])
585585

586586
# Note that /relations is tested separately in test_aggregation_get_event_for_thread
587587
# since it needs different data configured.

0 commit comments

Comments
 (0)