diff --git a/bindings/matrix-sdk-ffi/src/client_builder.rs b/bindings/matrix-sdk-ffi/src/client_builder.rs index d9bd68f2790..4035976fd19 100644 --- a/bindings/matrix-sdk-ffi/src/client_builder.rs +++ b/bindings/matrix-sdk-ffi/src/client_builder.rs @@ -527,6 +527,10 @@ impl ClientBuilder { inner_builder = inner_builder.with_encryption_settings(builder.encryption_settings); + if let Some(sliding_sync_proxy) = builder.sliding_sync_proxy { + inner_builder = inner_builder.sliding_sync_proxy(sliding_sync_proxy); + } + inner_builder = inner_builder.simplified_sliding_sync(builder.is_simplified_sliding_sync_enabled); @@ -536,25 +540,6 @@ impl ClientBuilder { let sdk_client = inner_builder.build().await?; - // At this point, `sdk_client` might contain a `sliding_sync_proxy` that has - // been configured by the homeserver (if it's a `ServerName` and the - // `.well-known` file is filled as expected). - // - // If `builder.sliding_sync_proxy` contains `Some(_)`, it means one wants to - // overwrite this value. It would be an error to call - // `sdk_client.set_sliding_sync_proxy()` with `None`, as it would erase the - // `sliding_sync_proxy` if any, and it's not the intended behavior. - // - // So let's call `sdk_client.set_sliding_sync_proxy()` if and only if there is - // `Some(_)` value in `builder.sliding_sync_proxy`. That's really important: It - // might not break an existing app session, but it is likely to break a new - // session, which not immediate to detect if there is no test. - if !builder.is_simplified_sliding_sync_enabled { - if let Some(sliding_sync_proxy) = builder.sliding_sync_proxy { - sdk_client.set_sliding_sync_proxy(Some(Url::parse(&sliding_sync_proxy)?)); - } - } - Ok(Arc::new( Client::new( sdk_client,