Skip to content

Commit

Permalink
make bola stream messages, thereby dodging the race condition with pu…
Browse files Browse the repository at this point in the history
…blish_intents
  • Loading branch information
insipx committed Jul 8, 2024
1 parent f62af60 commit 13928ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ mod tests {
assert!(stream.is_closed());
}

#[tokio::test(flavor = "current_thread")]
#[tokio::test(flavor = "multi_thread")]
async fn test_message_streaming() {
let amal = new_test_client().await;
let bola = new_test_client().await;
Expand All @@ -1956,8 +1956,11 @@ mod tests {
.await
.unwrap();

bola.inner_client.sync_welcomes().await.unwrap();
let bola_group = bola.group(amal_group.group_id.clone()).unwrap();

let stream_callback = RustStreamCallback::default();
let stream_closer = amal_group.stream(Box::new(stream_callback.clone()));
let stream_closer = bola_group.stream(Box::new(stream_callback.clone()));
log::info!("WAITING FOR READY");
stream_closer.wait_for_ready().await;

Expand Down
1 change: 1 addition & 0 deletions xmtp_mls/src/groups/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ impl MlsGroup {
let intent = provider
.conn()
.find_group_intent_by_payload_hash(sha256(envelope.data.as_slice()));
log::info!("INTENT IN `process_message` is {:?}", intent);

match intent {
// Intent with the payload hash matches
Expand Down

0 comments on commit 13928ad

Please sign in to comment.