diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index f8219aac0..a3f6de8ed 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -15,6 +15,7 @@ use xmtp_id::{ }, InboxId, }; +use xmtp_mls::groups::scoped_client::LocalScopedGroupClient; use xmtp_mls::storage::group_message::MsgQueryArgs; use xmtp_mls::storage::group_message::SortDirection; use xmtp_mls::{ @@ -397,10 +398,15 @@ impl FfiXmtpClient { } pub async fn request_history_sync(&self) -> Result<(), GenericError> { + let provider = self + .inner_client + .mls_provider() + .map_err(GenericError::from_error)?; self.inner_client - .send_history_sync_request() + .send_history_sync_request(&provider) .await .map_err(GenericError::from_error)?; + Ok(()) } diff --git a/bindings_node/src/mls_client.rs b/bindings_node/src/mls_client.rs index 9d9162aa0..12eb9dec9 100644 --- a/bindings_node/src/mls_client.rs +++ b/bindings_node/src/mls_client.rs @@ -13,6 +13,7 @@ pub use xmtp_api_grpc::grpc_api_helper::Client as TonicApiClient; use xmtp_cryptography::signature::ed25519_public_key_to_address; use xmtp_id::associations::builder::SignatureRequest; use xmtp_mls::builder::ClientBuilder; +use xmtp_mls::groups::scoped_client::LocalScopedGroupClient; use xmtp_mls::identity::IdentityStrategy; use xmtp_mls::storage::{EncryptedMessageStore, EncryptionKey, StorageOption}; use xmtp_mls::Client as MlsClient; @@ -179,11 +180,15 @@ impl NapiClient { #[napi] pub async fn request_history_sync(&self) -> Result<()> { + let provider = self + .inner_client + .mls_provider() + .map_err(ErrorWrapper::from)?; let _ = self .inner_client - .send_history_sync_request() + .send_history_sync_request(&provider) .await - .map_err(ErrorWrapper::from); + .map_err(ErrorWrapper::from)?; Ok(()) } diff --git a/bindings_wasm/src/mls_client.rs b/bindings_wasm/src/mls_client.rs index 2c355636d..b2caf8237 100644 --- a/bindings_wasm/src/mls_client.rs +++ b/bindings_wasm/src/mls_client.rs @@ -9,6 +9,7 @@ use xmtp_cryptography::signature::ed25519_public_key_to_address; use xmtp_id::associations::builder::SignatureRequest; use xmtp_id::associations::unverified::UnverifiedSignature; use xmtp_mls::builder::ClientBuilder; +use xmtp_mls::groups::scoped_client::LocalScopedGroupClient; use xmtp_mls::identity::IdentityStrategy; use xmtp_mls::storage::consent_record::StoredConsentRecord; use xmtp_mls::storage::{EncryptedMessageStore, EncryptionKey, StorageOption}; @@ -287,9 +288,13 @@ impl WasmClient { #[wasm_bindgen(js_name = requestHistorySync)] pub async fn request_history_sync(&self) -> Result<(), JsError> { + let provider = self + .inner_client + .mls_provider() + .map_err(|e| JsError::new(format!("{}", e).as_str()))?; let _ = self .inner_client - .send_history_sync_request() + .send_history_sync_request(&provider) .await .map_err(|e| JsError::new(format!("{}", e).as_str()))?; diff --git a/examples/cli/cli-client.rs b/examples/cli/cli-client.rs index d95b623fc..79009cc07 100755 --- a/examples/cli/cli-client.rs +++ b/examples/cli/cli-client.rs @@ -355,8 +355,8 @@ async fn main() { let conn = client.store().conn().unwrap(); let provider = client.mls_provider().unwrap(); client.sync_welcomes(&conn).await.unwrap(); - client.create_sync_group(&provider).await.unwrap(); - let (group_id, _) = client.send_history_sync_request().await.unwrap(); + client.enable_sync(&provider).await.unwrap(); + let (group_id, _) = client.send_history_sync_request(&provider).await.unwrap(); let group_id_str = hex::encode(group_id); info!("Sent history sync request in sync group {group_id_str}", { group_id: group_id_str}) } @@ -382,7 +382,7 @@ async fn main() { let conn = client.store().conn().unwrap(); let provider = client.mls_provider().unwrap(); client.sync_welcomes(&conn).await.unwrap(); - client.create_sync_group(&provider).await.unwrap(); + client.enable_sync(&provider).await.unwrap(); client.process_history_sync_reply(&provider).await.unwrap(); info!("History bundle downloaded and inserted into user DB", {}) @@ -394,7 +394,7 @@ async fn main() { let conn = client.store().conn().unwrap(); let provider = client.mls_provider().unwrap(); client.sync_welcomes(&conn).await.unwrap(); - client.create_sync_group(&provider).await.unwrap(); + client.enable_sync(&provider).await.unwrap(); client.process_consent_sync_reply(&provider).await.unwrap(); info!("Consent bundle downloaded and inserted into user DB", {}) @@ -406,7 +406,7 @@ async fn main() { let conn = client.store().conn().unwrap(); let provider = client.mls_provider().unwrap(); client.sync_welcomes(&conn).await.unwrap(); - client.create_sync_group(&provider).await.unwrap(); + client.enable_sync(&provider).await.unwrap(); let group = client.get_sync_group().unwrap(); let group_id_str = hex::encode(group.group_id.clone()); group.sync().await.unwrap();