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

Commit ab3165e

Browse files
authored
Remove experimental configuration flag for MSC3666. (#12436)
1 parent 4586119 commit ab3165e

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

changelog.d/12436.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Include bundled aggregations in search results
2+
([MSC3666](https://github.com/matrix-org/matrix-spec-proposals/pull/3666)).

synapse/config/experimental.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
2828

2929
# MSC3440 (thread relation)
3030
self.msc3440_enabled: bool = experimental.get("msc3440_enabled", False)
31-
# MSC3666: including bundled relations in /search.
32-
self.msc3666_enabled: bool = experimental.get("msc3666_enabled", False)
3331

3432
# MSC3026 (busy presence state)
3533
self.msc3026_enabled: bool = experimental.get("msc3026_enabled", False)

synapse/handlers/search.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ def __init__(self, hs: "HomeServer"):
5959
self.state_store = self.storage.state
6060
self.auth = hs.get_auth()
6161

62-
self._msc3666_enabled = hs.config.experimental.msc3666_enabled
63-
6462
async def get_old_rooms_from_upgraded_room(self, room_id: str) -> Iterable[str]:
6563
"""Retrieves room IDs of old rooms in the history of an upgraded room.
6664
@@ -353,22 +351,20 @@ async def _search(
353351
state = await self.state_handler.get_current_state(room_id)
354352
state_results[room_id] = list(state.values())
355353

356-
aggregations = None
357-
if self._msc3666_enabled:
358-
aggregations = await self._relations_handler.get_bundled_aggregations(
359-
# Generate an iterable of EventBase for all the events that will be
360-
# returned, including contextual events.
361-
itertools.chain(
362-
# The events_before and events_after for each context.
363-
itertools.chain.from_iterable(
364-
itertools.chain(context["events_before"], context["events_after"]) # type: ignore[arg-type]
365-
for context in contexts.values()
366-
),
367-
# The returned events.
368-
search_result.allowed_events,
354+
aggregations = await self._relations_handler.get_bundled_aggregations(
355+
# Generate an iterable of EventBase for all the events that will be
356+
# returned, including contextual events.
357+
itertools.chain(
358+
# The events_before and events_after for each context.
359+
itertools.chain.from_iterable(
360+
itertools.chain(context["events_before"], context["events_after"]) # type: ignore[arg-type]
361+
for context in contexts.values()
369362
),
370-
user.to_string(),
371-
)
363+
# The returned events.
364+
search_result.allowed_events,
365+
),
366+
user.to_string(),
367+
)
372368

373369
# We're now about to serialize the events. We should not make any
374370
# blocking calls after this. Otherwise, the 'age' will be wrong.

0 commit comments

Comments
 (0)