Skip to content

Commit

Permalink
Merge branch 'coda/stitching' of github.com:xmtp/libxmtp into coda/st…
Browse files Browse the repository at this point in the history
…itching
  • Loading branch information
codabrink committed Dec 19, 2024
2 parents 825b83f + eb44a15 commit d4d3d30
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
19 changes: 6 additions & 13 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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<XmtpApiClient>,
account_address: String,
) -> Result<Option<String>, 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)?;
Expand Down Expand Up @@ -2135,8 +2127,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
Expand Down
4 changes: 4 additions & 0 deletions bindings_node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion bindings_node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xmtp/node-bindings",
"version": "0.0.29",
"version": "0.0.30",
"repository": {
"type": "git",
"url": "git+https://[email protected]/xmtp/libxmtp.git",
Expand Down
4 changes: 4 additions & 0 deletions bindings_wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion bindings_wasm/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 6 additions & 5 deletions xmtp_api_grpc/src/replication_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<_>, Error> = envelopes
.iter()
.map(|envelopes| {
Expand Down Expand Up @@ -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))?;
Expand Down Expand Up @@ -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))?;
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -466,6 +466,7 @@ impl ClientV4 {
async fn query_v4_envelopes(
&self,
topics: Vec<Vec<u8>>,
limit: u32,
) -> Result<Vec<Vec<OriginatorEnvelope>>, Error> {
let requests = topics.iter().map(|topic| async {
let client = &mut self.client.clone();
Expand All @@ -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))?;
Expand Down

0 comments on commit d4d3d30

Please sign in to comment.