Skip to content

Commit 7767ef6

Browse files
committed
fix(ffi): Adapt FFI calls to Client::server_vendor_info to the new API
Specially important, the one from `ClientBuilder::build` as it avoids a situation where the builder would infinitely try to get a response for this request and never create the `Client` or fail.
1 parent 6765ca0 commit 7767ef6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bindings/matrix-sdk-ffi/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ impl Client {
16281628
/// This method retrieves information about the server's name and version
16291629
/// by calling the `/_matrix/federation/v1/version` endpoint.
16301630
pub async fn server_vendor_info(&self) -> Result<matrix_sdk::ServerVendorInfo, ClientError> {
1631-
Ok(self.inner.server_vendor_info().await?)
1631+
Ok(self.inner.server_vendor_info(None).await?)
16321632
}
16331633

16341634
/// Subscribe to changes in the media preview configuration.

bindings/matrix-sdk-ffi/src/client_builder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,12 @@ impl ClientBuilder {
574574

575575
let sdk_client = inner_builder.build().await?;
576576

577+
// Disable retries for this request to prevent it from being retried
578+
// indefinitely
579+
let config = sdk_client.request_config().disable_retry();
580+
577581
// Log server version information at info level.
578-
if let Ok(server_info) = sdk_client.server_vendor_info().await {
582+
if let Ok(server_info) = sdk_client.server_vendor_info(Some(config)).await {
579583
tracing::info!(
580584
server_name = %server_info.server_name,
581585
version = %server_info.version,

0 commit comments

Comments
 (0)