Skip to content

Commit e610c36

Browse files
committed
Put MSC4308 behind the MSC4306 feature flag
1 parent e7ff810 commit e610c36

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

synapse/config/experimental.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,5 +583,5 @@ def read_config(
583583
self.msc4155_enabled: bool = experimental.get("msc4155_enabled", False)
584584

585585
# MSC4306: Thread Subscriptions
586-
# (and MSC4308: sliding sync extension for thread subscriptions)
586+
# (and MSC4308: Thread Subscriptions extension to Sliding Sync)
587587
self.msc4306_enabled: bool = experimental.get("msc4306_enabled", False)

synapse/handlers/sliding_sync/extensions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def __init__(self, hs: "HomeServer"):
7070
self.event_sources = hs.get_event_sources()
7171
self.device_handler = hs.get_device_handler()
7272
self.push_rules_handler = hs.get_push_rules_handler()
73+
self._enable_thread_subscriptions = hs.config.experimental.msc4306_enabled
7374

7475
@trace
7576
async def get_extensions_response(
@@ -163,7 +164,10 @@ async def get_extensions_response(
163164
)
164165

165166
thread_subs_coro = None
166-
if sync_config.extensions.thread_subscriptions is not None:
167+
if (
168+
sync_config.extensions.thread_subscriptions is not None
169+
and self._enable_thread_subscriptions
170+
):
167171
thread_subs_coro = self.get_thread_subscriptions_extension_response(
168172
sync_config=sync_config,
169173
thread_subscriptions_request=sync_config.extensions.thread_subscriptions,

tests/rest/client/sliding_sync/test_extension_thread_subscriptions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class SlidingSyncThreadSubscriptionsExtensionTestCase(SlidingSyncBase):
3838
sync.register_servlets,
3939
]
4040

41+
def default_config(self) -> JsonDict:
42+
config = super().default_config()
43+
config["experimental_features"] = {"msc4306_enabled": True}
44+
return config
45+
4146
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
4247
self.store = hs.get_datastores().main
4348
self.storage_controllers = hs.get_storage_controllers()

0 commit comments

Comments
 (0)