From 3a860d7d456120e1f0268d1e8b7b06ce99f4f89c Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Wed, 18 Dec 2024 11:33:42 -0500 Subject: [PATCH 1/3] use XmtpApiClient in getInboxIds (#1429) * use XmtpApiClient in getInboxIds * fix test --- Cargo.lock | 1 - bindings_ffi/src/mls.rs | 19 ++++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5627ff5d8..cf5f4a245 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7518,7 +7518,6 @@ dependencies = [ "tracing-oslog", "tracing-subscriber", "uniffi", - "url", "uuid 1.11.0", "xmtp_api_grpc", "xmtp_common", diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 339c9c23e..4ac46b3c1 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -4,7 +4,6 @@ use crate::{FfiSubscribeError, GenericError}; use std::{collections::HashMap, convert::TryInto, sync::Arc}; use tokio::sync::Mutex; use xmtp_api_grpc::grpc_api_helper::Client as TonicApiClient; -use xmtp_common::retry::Retry; use xmtp_id::associations::verify_signed_with_public_context; use xmtp_id::scw_verifier::RemoteSignatureVerifier; use xmtp_id::{ @@ -155,18 +154,11 @@ pub async fn create_client( #[allow(unused)] #[uniffi::export(async_runtime = "tokio")] pub async fn get_inbox_id_for_address( - host: String, - is_secure: bool, + api: Arc, account_address: String, ) -> Result, GenericError> { - let api_client = ApiClientWrapper::new( - TonicApiClient::create(host.clone(), is_secure) - .await? - .into(), - Retry::default(), - ); - - let results = api_client + let api = ApiClientWrapper::new(Arc::new(api.0.clone()), Default::default()); + let results = api .get_inbox_ids(vec![account_address.clone()]) .await .map_err(GenericError::from_error)?; @@ -2136,8 +2128,9 @@ mod tests { let real_inbox_id = client.inbox_id(); let from_network = get_inbox_id_for_address( - xmtp_api_grpc::LOCALHOST_ADDRESS.to_string(), - false, + connect_to_backend(xmtp_api_grpc::LOCALHOST_ADDRESS.to_string(), false) + .await + .unwrap(), client.account_address.clone(), ) .await From eccce0610585310713951a995200bb6e8dfd8bf6 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Wed, 18 Dec 2024 11:39:46 -0600 Subject: [PATCH 2/3] Prepare releases for WASM and Node bindings (#1431) --- bindings_node/CHANGELOG.md | 4 ++++ bindings_node/package.json | 2 +- bindings_wasm/CHANGELOG.md | 4 ++++ bindings_wasm/package.json | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bindings_node/CHANGELOG.md b/bindings_node/CHANGELOG.md index 98fc50dc7..d80620ac7 100644 --- a/bindings_node/CHANGELOG.md +++ b/bindings_node/CHANGELOG.md @@ -1,5 +1,9 @@ # @xmtp/node-bindings +## 0.0.30 + +- Fixed issue that resulted in a forked group + ## 0.0.29 - Added support for custom permission policy sets diff --git a/bindings_node/package.json b/bindings_node/package.json index 4bc65d3e6..4f8433118 100644 --- a/bindings_node/package.json +++ b/bindings_node/package.json @@ -1,6 +1,6 @@ { "name": "@xmtp/node-bindings", - "version": "0.0.29", + "version": "0.0.30", "repository": { "type": "git", "url": "git+https://git@github.com/xmtp/libxmtp.git", diff --git a/bindings_wasm/CHANGELOG.md b/bindings_wasm/CHANGELOG.md index b55cfc295..727f22b02 100644 --- a/bindings_wasm/CHANGELOG.md +++ b/bindings_wasm/CHANGELOG.md @@ -1,5 +1,9 @@ # @xmtp/wasm-bindings +## 0.0.9 + +- Fixed issue that resulted in a forked group + ## 0.0.8 - Added support for custom permission policy sets diff --git a/bindings_wasm/package.json b/bindings_wasm/package.json index 82002185a..9565a29b4 100644 --- a/bindings_wasm/package.json +++ b/bindings_wasm/package.json @@ -1,6 +1,6 @@ { "name": "@xmtp/wasm-bindings", - "version": "0.0.8", + "version": "0.0.9", "type": "module", "license": "MIT", "description": "WASM bindings for the libXMTP rust library", From a0791f01ee10c84ac155151f642eac55a72083a2 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Thu, 19 Dec 2024 08:20:38 -0500 Subject: [PATCH 3/3] Honor paging limit when available (#1433) * Honor paging limit when available * linter --- xmtp_api_grpc/src/replication_client.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xmtp_api_grpc/src/replication_client.rs b/xmtp_api_grpc/src/replication_client.rs index ee9a33141..e13b07adc 100644 --- a/xmtp_api_grpc/src/replication_client.rs +++ b/xmtp_api_grpc/src/replication_client.rs @@ -190,7 +190,7 @@ impl XmtpMlsClient for ClientV4 { .map(|key| build_key_package_topic(key.as_slice())) .collect(); - let envelopes = self.query_v4_envelopes(topics).await?; + let envelopes = self.query_v4_envelopes(topics, 0).await?; let key_packages: Result, Error> = envelopes .iter() .map(|envelopes| { @@ -248,7 +248,7 @@ impl XmtpMlsClient for ClientV4 { originator_node_ids: vec![], last_seen: None, }), - limit: 100, + limit: req.paging_info.map_or(0, |paging| paging.limit), }) .await .map_err(|e| Error::new(ErrorKind::MlsError).with(e))?; @@ -304,7 +304,7 @@ impl XmtpMlsClient for ClientV4 { originator_node_ids: vec![], last_seen: None, }), - limit: 100, + limit: req.paging_info.map_or(0, |paging| paging.limit), }) .await .map_err(|e| Error::new(ErrorKind::MlsError).with(e))?; @@ -418,7 +418,7 @@ impl XmtpIdentityClient for ClientV4 { .iter() .map(|r| build_identity_topic_from_hex_encoded(&r.inbox_id.clone())) .collect(); - let v4_envelopes = self.query_v4_envelopes(topics?).await?; + let v4_envelopes = self.query_v4_envelopes(topics?, 0).await?; let joined_data = v4_envelopes .into_iter() .zip(request.requests.into_iter()) @@ -466,6 +466,7 @@ impl ClientV4 { async fn query_v4_envelopes( &self, topics: Vec>, + limit: u32, ) -> Result>, Error> { let requests = topics.iter().map(|topic| async { let client = &mut self.client.clone(); @@ -476,7 +477,7 @@ impl ClientV4 { originator_node_ids: vec![], last_seen: None, }), - limit: 100, + limit, }) .await .map_err(|err| Error::new(ErrorKind::IdentityError).with(err))?;