From 449c27642ceeb02bfbd6811528b03cdbc71dab49 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 8 Sep 2024 14:07:16 -0700 Subject: [PATCH] hide sliding sync behind explicit option We want to make sure users know this sliding sync impl is pretty buggy before they attempt to use it. --- src/api/well_known.rs | 12 +++++++++--- src/config.rs | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/api/well_known.rs b/src/api/well_known.rs index e32d45cb..f0c0df07 100644 --- a/src/api/well_known.rs +++ b/src/api/well_known.rs @@ -51,8 +51,14 @@ pub(crate) async fn client(_: Ar) -> Ra { Ra(client::Response { homeserver: client::HomeserverInfo::new(base_url.clone()), identity_server: None, - sliding_sync_proxy: Some(client::SlidingSyncProxyInfo { - url: base_url, - }), + sliding_sync_proxy: services() + .globals + .config + .server_discovery + .client + .advertise_sliding_sync + .then_some(client::SlidingSyncProxyInfo { + url: base_url, + }), }) } diff --git a/src/config.rs b/src/config.rs index e331364f..51761f85 100644 --- a/src/config.rs +++ b/src/config.rs @@ -96,6 +96,9 @@ pub(crate) struct ClientServerDiscovery { /// Controls whether HTTPS is used #[serde(default)] pub(crate) insecure: bool, + + #[serde(default, rename = "advertise_buggy_sliding_sync")] + pub(crate) advertise_sliding_sync: bool, } #[derive(Debug, Deserialize)]