From ddcfefdc96bfe1df1175c764bc5bba9abb8c083d Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Wed, 17 Jul 2024 11:39:17 -0600 Subject: [PATCH 01/10] lock stuff --- bindings_ffi/Cargo.lock | 2 ++ bindings_node/Cargo.lock | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bindings_ffi/Cargo.lock b/bindings_ffi/Cargo.lock index 9c6dbe3ad..ac3c0372e 100644 --- a/bindings_ffi/Cargo.lock +++ b/bindings_ffi/Cargo.lock @@ -4848,6 +4848,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -5903,6 +5904,7 @@ dependencies = [ "thiserror", "tls_codec 0.4.0", "tokio", + "tokio-stream", "toml 0.8.8", "tracing", "xmtp_cryptography", diff --git a/bindings_node/Cargo.lock b/bindings_node/Cargo.lock index a0e9a9c94..d50511cea 100644 --- a/bindings_node/Cargo.lock +++ b/bindings_node/Cargo.lock @@ -4588,6 +4588,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -5452,6 +5453,7 @@ dependencies = [ "thiserror", "tls_codec 0.4.1", "tokio", + "tokio-stream", "toml", "tracing", "xmtp_cryptography", From ccf4e65dcb369f7765ae448c323c5951cd6c1cff Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 22 Jul 2024 17:35:55 -0600 Subject: [PATCH 02/10] reproduced it in a test --- bindings_ffi/src/mls.rs | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 497d7f49d..51464d314 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2056,6 +2056,73 @@ mod tests { assert!(stream_messages.is_closed()); } + // User A = AlexDev3 which is on Epoch A + // User B = Alex1 which is on Epoch B + // User A originally created the group + // User A Added User B to the chat + // User A Added User C & User D to the chat + // User A Removed C & D + // User A added Users E & F + // Below are the logs for User B when trying to load + + #[tokio::test(flavor = "multi_thread", worker_threads = 5)] + async fn test_can_add_and_remove_forking_group() { + let alix = new_test_client().await; + let bo = new_test_client().await; + let caro = new_test_client().await; + let davon = new_test_client().await; + let eri = new_test_client().await; + let frankie = new_test_client().await; + + // Create group and send first message + let alix_group = alix + .conversations() + .create_group(vec![bo.account_address.clone()], FfiCreateGroupOptions::default()) + .await + .unwrap(); + + bo.conversations().sync().await.unwrap(); + let bo_group = bo.group(alix_group.id()).unwrap(); + + bo_group.send("bo1".as_bytes().to_vec()).await.unwrap(); + alix_group.send("alix1".as_bytes().to_vec()).await.unwrap(); + + alix_group.add_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]).await.unwrap(); + + bo_group.send("bo2".as_bytes().to_vec()).await.unwrap(); + alix_group.send("alix2".as_bytes().to_vec()).await.unwrap(); + + alix_group.remove_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]).await.unwrap(); + alix_group.add_members(vec![ + eri.account_address.clone(), + frankie.account_address.clone(), + ]).await.unwrap(); + + bo_group.send("bo3".as_bytes().to_vec()).await.unwrap(); + alix_group.send("alix3".as_bytes().to_vec()).await.unwrap(); + bo_group.send("bo4".as_bytes().to_vec()).await.unwrap(); + bo_group.send("bo5".as_bytes().to_vec()).await.unwrap(); + + bo_group.sync().await.unwrap(); + alix_group.sync().await.unwrap(); + + let alix_messages = alix_group + .find_messages(FfiListMessagesOptions::default()) + .unwrap(); + let bo_messages = bo_group + .find_messages(FfiListMessagesOptions::default()) + .unwrap(); + assert_eq!(bo_messages.len(), 11); + assert_eq!(alix_messages.len(), 12); + + assert_eq!(bo_messages[0].id, alix_messages[0].id); + } // test is also showing intermittent failures with database locked msg #[ignore] From fffe60b5093b3d37bcad99a20eae75e69e320148 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Tue, 23 Jul 2024 17:13:39 -0700 Subject: [PATCH 03/10] Simplify and explain test --- bindings_ffi/src/mls.rs | 63 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 51464d314..a4827ca06 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2056,17 +2056,9 @@ mod tests { assert!(stream_messages.is_closed()); } - // User A = AlexDev3 which is on Epoch A - // User B = Alex1 which is on Epoch B - // User A originally created the group - // User A Added User B to the chat - // User A Added User C & User D to the chat - // User A Removed C & D - // User A added Users E & F - // Below are the logs for User B when trying to load #[tokio::test(flavor = "multi_thread", worker_threads = 5)] - async fn test_can_add_and_remove_forking_group() { + async fn test_can_send_message_when_out_of_sync() { let alix = new_test_client().await; let bo = new_test_client().await; let caro = new_test_client().await; @@ -2077,33 +2069,44 @@ mod tests { // Create group and send first message let alix_group = alix .conversations() - .create_group(vec![bo.account_address.clone()], FfiCreateGroupOptions::default()) + .create_group( + vec![bo.account_address.clone()], + FfiCreateGroupOptions::default(), + ) .await .unwrap(); - + bo.conversations().sync().await.unwrap(); let bo_group = bo.group(alix_group.id()).unwrap(); - + bo_group.send("bo1".as_bytes().to_vec()).await.unwrap(); alix_group.send("alix1".as_bytes().to_vec()).await.unwrap(); - alix_group.add_members(vec![ - caro.account_address.clone(), - davon.account_address.clone(), - ]).await.unwrap(); - - bo_group.send("bo2".as_bytes().to_vec()).await.unwrap(); - alix_group.send("alix2".as_bytes().to_vec()).await.unwrap(); - - alix_group.remove_members(vec![ - caro.account_address.clone(), - davon.account_address.clone(), - ]).await.unwrap(); - alix_group.add_members(vec![ - eri.account_address.clone(), - frankie.account_address.clone(), - ]).await.unwrap(); + // Move the group forward by 3 epochs (as Alix's max_past_epochs is + // configured to 3) without Bo syncing + alix_group + .add_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]) + .await + .unwrap(); + alix_group + .remove_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]) + .await + .unwrap(); + alix_group + .add_members(vec![ + eri.account_address.clone(), + frankie.account_address.clone(), + ]) + .await + .unwrap(); + // Bo sends messages to Alix while 3 epochs behind bo_group.send("bo3".as_bytes().to_vec()).await.unwrap(); alix_group.send("alix3".as_bytes().to_vec()).await.unwrap(); bo_group.send("bo4".as_bytes().to_vec()).await.unwrap(); @@ -2118,8 +2121,8 @@ mod tests { let bo_messages = bo_group .find_messages(FfiListMessagesOptions::default()) .unwrap(); - assert_eq!(bo_messages.len(), 11); - assert_eq!(alix_messages.len(), 12); + assert_eq!(bo_messages.len(), 9); + assert_eq!(alix_messages.len(), 10); assert_eq!(bo_messages[0].id, alix_messages[0].id); } From dd98d77051f9c54cf23338526629431836ca4edf Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Tue, 23 Jul 2024 17:53:18 -0700 Subject: [PATCH 04/10] Make the test case even harder --- bindings_ffi/src/mls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index a4827ca06..16f70f185 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2112,12 +2112,12 @@ mod tests { bo_group.send("bo4".as_bytes().to_vec()).await.unwrap(); bo_group.send("bo5".as_bytes().to_vec()).await.unwrap(); - bo_group.sync().await.unwrap(); alix_group.sync().await.unwrap(); - let alix_messages = alix_group .find_messages(FfiListMessagesOptions::default()) .unwrap(); + + bo_group.sync().await.unwrap(); let bo_messages = bo_group .find_messages(FfiListMessagesOptions::default()) .unwrap(); From 0732ac08d11d3e6b164b7ad0ab31553c83e968be Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 14:52:24 -0700 Subject: [PATCH 05/10] Fix last condition of test --- bindings_ffi/src/mls.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 16f70f185..4bf828c99 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2066,7 +2066,6 @@ mod tests { let eri = new_test_client().await; let frankie = new_test_client().await; - // Create group and send first message let alix_group = alix .conversations() .create_group( @@ -2124,7 +2123,10 @@ mod tests { assert_eq!(bo_messages.len(), 9); assert_eq!(alix_messages.len(), 10); - assert_eq!(bo_messages[0].id, alix_messages[0].id); + assert_eq!( + bo_messages[bo_messages.len() - 1].id, + alix_messages[alix_messages.len() - 1].id + ); } // test is also showing intermittent failures with database locked msg From 7e2c673e82fd405f4480a090b68357116abe7d53 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 15:10:46 -0700 Subject: [PATCH 06/10] Fix message sends when behind --- xmtp_mls/src/groups/mod.rs | 7 +++- xmtp_mls/src/groups/sync.rs | 73 ++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 7 deletions(-) diff --git a/xmtp_mls/src/groups/mod.rs b/xmtp_mls/src/groups/mod.rs index fab5e49df..e8a4db420 100644 --- a/xmtp_mls/src/groups/mod.rs +++ b/xmtp_mls/src/groups/mod.rs @@ -440,10 +440,12 @@ impl MlsGroup { let message_id = self.prepare_message(message, &conn); // Skipping a full sync here and instead just firing and forgetting - if let Err(err) = self.publish_intents(conn, client).await { + if let Err(err) = self.publish_intents(conn.clone(), client).await { log::error!("Send: error publishing intents: {:?}", err); } + self.sync_until_all_intents_resolved(conn, client).await?; + message_id } @@ -459,7 +461,8 @@ impl MlsGroup { let update_interval = Some(5_000_000); self.maybe_update_installations(conn.clone(), update_interval, client) .await?; - self.publish_intents(conn, client).await?; + self.publish_intents(conn.clone(), client).await?; + self.sync_until_all_intents_resolved(conn, client).await?; Ok(()) } diff --git a/xmtp_mls/src/groups/sync.rs b/xmtp_mls/src/groups/sync.rs index ef059cd66..59c93b5c9 100644 --- a/xmtp_mls/src/groups/sync.rs +++ b/xmtp_mls/src/groups/sync.rs @@ -46,6 +46,7 @@ use openmls::{ credentials::BasicCredential, extensions::Extensions, framing::{MlsMessageOut, ProtocolMessage}, + group::GroupEpoch, prelude::{ tls_codec::{Deserialize, Serialize}, LeafNodeIndex, MlsGroup as OpenMlsGroup, MlsMessageBodyIn, MlsMessageIn, PrivateMessageIn, @@ -133,6 +134,28 @@ impl MlsGroup { Ok(()) } + pub(super) async fn sync_until_all_intents_resolved( + &self, + conn: DbConnection, + client: &Client, + ) -> Result<(), GroupError> + where + ApiClient: XmtpApi, + { + let intents = conn.find_group_intents( + self.group_id.clone(), + Some(vec![IntentState::ToPublish, IntentState::Published]), + None, + )?; + + if intents.is_empty() { + return Ok(()); + } + + self.sync_until_intent_resolved(conn, intents[intents.len() - 1].id, client) + .await + } + /** * Sync the group and wait for the intent to be deleted * Group syncing may involve picking up messages unrelated to the intent, so simply checking for errors @@ -188,6 +211,35 @@ impl MlsGroup { Err(last_err.unwrap_or(GroupError::Generic("failed to wait for intent".to_string()))) } + fn is_valid_epoch( + inbox_id: InboxId, + intent_id: i32, + group_epoch: GroupEpoch, + message_epoch: GroupEpoch, + ) -> bool { + if message_epoch < group_epoch { + log::warn!( + "[{}] own message epoch {} is less than group epoch {} for intent {}. Retrying message", + inbox_id, + message_epoch, + group_epoch, + intent_id + ); + return false; + } else if message_epoch > group_epoch { + // Should not happen, logging proactively + log::error!( + "[{}] own message epoch {} is greater than group epoch {} for intent {}. Retrying message", + inbox_id, + message_epoch, + group_epoch, + intent_id + ); + return false; + } + return true; + } + #[allow(clippy::too_many_arguments)] #[tracing::instrument(level = "trace", skip_all)] async fn process_own_message( @@ -203,11 +255,15 @@ impl MlsGroup { if intent.state == IntentState::Committed { return Ok(()); } + let message_epoch = message.epoch(); + let group_epoch = openmls_group.epoch(); debug!( - "[{}] processing own message for intent {} / {:?}", + "[{}] processing own message for intent {} / {:?}, group epoch: {}, message_epoch: {}", self.context.inbox_id(), intent.id, - intent.kind + intent.kind, + group_epoch, + message_epoch ); let conn = provider.conn(); @@ -223,8 +279,6 @@ impl MlsGroup { let maybe_pending_commit = openmls_group.pending_commit(); // We don't get errors with merge_pending_commit when there are no commits to merge if maybe_pending_commit.is_none() { - let message_epoch = message.epoch(); - let group_epoch = openmls_group.epoch(); debug!( "no pending commit to merge. Group epoch: {}. Message epoch: {}", group_epoch, message_epoch @@ -281,6 +335,15 @@ impl MlsGroup { } } IntentKind::SendMessage => { + if !Self::is_valid_epoch( + self.context.inbox_id(), + intent.id, + group_epoch, + message_epoch, + ) { + conn.set_group_intent_to_publish(intent.id)?; + return Ok(()); + } if let Some(id) = intent.message_id()? { conn.set_delivery_status_to_published(&id, envelope_timestamp_ns)?; } @@ -532,7 +595,7 @@ impl MlsGroup { // Intent with the payload hash matches Ok(Some(intent)) => { log::info!( - "client [{}] is about to process own envelope [{}]", + "client [{}] is about to process own envelope [{}]", client.inbox_id(), envelope.id ); From b7543d9bc7e4ecb3c8b3666e87772b813fc32812 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 15:23:56 -0700 Subject: [PATCH 07/10] Add test to make sure commits work when out of sync --- bindings_ffi/src/mls.rs | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index c641b4f9e..70ec8c8ea 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2156,6 +2156,66 @@ mod tests { assert!(stream_messages.is_closed()); } + #[tokio::test(flavor = "multi_thread", worker_threads = 5)] + async fn test_can_add_members_when_out_of_sync() { + let alix = new_test_client().await; + let bo = new_test_client().await; + let caro = new_test_client().await; + let davon = new_test_client().await; + let eri = new_test_client().await; + let frankie = new_test_client().await; + + let alix_group = alix + .conversations() + .create_group( + vec![bo.account_address.clone()], + FfiCreateGroupOptions::default(), + ) + .await + .unwrap(); + + bo.conversations().sync().await.unwrap(); + let bo_group = bo.group(alix_group.id()).unwrap(); + + bo_group.send("bo1".as_bytes().to_vec()).await.unwrap(); + alix_group.send("alix1".as_bytes().to_vec()).await.unwrap(); + + // Move the group forward by 3 epochs (as Alix's max_past_epochs is + // configured to 3) without Bo syncing + alix_group + .add_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]) + .await + .unwrap(); + alix_group + .remove_members(vec![ + caro.account_address.clone(), + davon.account_address.clone(), + ]) + .await + .unwrap(); + alix_group + .add_members(vec![eri.account_address.clone()]) + .await + .unwrap(); + + // Bo adds a member while 3 epochs behind + bo_group + .add_members(vec![frankie.account_address.clone()]) + .await + .unwrap(); + + bo_group.sync().await.unwrap(); + let bo_members = bo_group.list_members().unwrap(); + assert_eq!(bo_members.len(), 4); + + alix_group.sync().await.unwrap(); + let alix_members = alix_group.list_members().unwrap(); + assert_eq!(alix_members.len(), 4); + } + #[tokio::test(flavor = "multi_thread", worker_threads = 5)] async fn test_can_send_message_when_out_of_sync() { let alix = new_test_client().await; From e36b81ad83fbb98e87d85e8f06020c0cc8b1afb7 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 15:50:18 -0700 Subject: [PATCH 08/10] Don't retry message if within 3 epochs --- xmtp_mls/src/groups/sync.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xmtp_mls/src/groups/sync.rs b/xmtp_mls/src/groups/sync.rs index 59c93b5c9..c146286c4 100644 --- a/xmtp_mls/src/groups/sync.rs +++ b/xmtp_mls/src/groups/sync.rs @@ -216,17 +216,19 @@ impl MlsGroup { intent_id: i32, group_epoch: GroupEpoch, message_epoch: GroupEpoch, + max_past_epochs: usize, ) -> bool { - if message_epoch < group_epoch { + if message_epoch.as_u64() + max_past_epochs as u64 <= group_epoch.as_u64() { log::warn!( - "[{}] own message epoch {} is less than group epoch {} for intent {}. Retrying message", + "[{}] own message epoch {} is {} or more less than group epoch {} for intent {}. Retrying message", inbox_id, message_epoch, + max_past_epochs, group_epoch, intent_id ); return false; - } else if message_epoch > group_epoch { + } else if message_epoch.as_u64() > group_epoch.as_u64() { // Should not happen, logging proactively log::error!( "[{}] own message epoch {} is greater than group epoch {} for intent {}. Retrying message", @@ -340,6 +342,7 @@ impl MlsGroup { intent.id, group_epoch, message_epoch, + 3, // max_past_epochs, TODO: expose from OpenMLS MlsGroup ) { conn.set_group_intent_to_publish(intent.id)?; return Ok(()); From 9d7df2afeff0fe2d3d3e1d42f3eef006a50c8f06 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 15:56:28 -0700 Subject: [PATCH 09/10] Reorder test for clarity, fix lint --- bindings_ffi/src/mls.rs | 68 ++++++++++++++++++------------------- xmtp_mls/src/groups/sync.rs | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 70ec8c8ea..eb1df7f4c 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -2157,7 +2157,7 @@ mod tests { } #[tokio::test(flavor = "multi_thread", worker_threads = 5)] - async fn test_can_add_members_when_out_of_sync() { + async fn test_can_send_message_when_out_of_sync() { let alix = new_test_client().await; let bo = new_test_client().await; let caro = new_test_client().await; @@ -2197,27 +2197,39 @@ mod tests { .await .unwrap(); alix_group - .add_members(vec![eri.account_address.clone()]) + .add_members(vec![ + eri.account_address.clone(), + frankie.account_address.clone(), + ]) .await .unwrap(); - // Bo adds a member while 3 epochs behind - bo_group - .add_members(vec![frankie.account_address.clone()]) - .await + // Bo sends messages to Alix while 3 epochs behind + bo_group.send("bo3".as_bytes().to_vec()).await.unwrap(); + alix_group.send("alix3".as_bytes().to_vec()).await.unwrap(); + bo_group.send("bo4".as_bytes().to_vec()).await.unwrap(); + bo_group.send("bo5".as_bytes().to_vec()).await.unwrap(); + + alix_group.sync().await.unwrap(); + let alix_messages = alix_group + .find_messages(FfiListMessagesOptions::default()) .unwrap(); bo_group.sync().await.unwrap(); - let bo_members = bo_group.list_members().unwrap(); - assert_eq!(bo_members.len(), 4); + let bo_messages = bo_group + .find_messages(FfiListMessagesOptions::default()) + .unwrap(); + assert_eq!(bo_messages.len(), 9); + assert_eq!(alix_messages.len(), 10); - alix_group.sync().await.unwrap(); - let alix_members = alix_group.list_members().unwrap(); - assert_eq!(alix_members.len(), 4); + assert_eq!( + bo_messages[bo_messages.len() - 1].id, + alix_messages[alix_messages.len() - 1].id + ); } #[tokio::test(flavor = "multi_thread", worker_threads = 5)] - async fn test_can_send_message_when_out_of_sync() { + async fn test_can_add_members_when_out_of_sync() { let alix = new_test_client().await; let bo = new_test_client().await; let caro = new_test_client().await; @@ -2257,35 +2269,23 @@ mod tests { .await .unwrap(); alix_group - .add_members(vec![ - eri.account_address.clone(), - frankie.account_address.clone(), - ]) + .add_members(vec![eri.account_address.clone()]) .await .unwrap(); - // Bo sends messages to Alix while 3 epochs behind - bo_group.send("bo3".as_bytes().to_vec()).await.unwrap(); - alix_group.send("alix3".as_bytes().to_vec()).await.unwrap(); - bo_group.send("bo4".as_bytes().to_vec()).await.unwrap(); - bo_group.send("bo5".as_bytes().to_vec()).await.unwrap(); - - alix_group.sync().await.unwrap(); - let alix_messages = alix_group - .find_messages(FfiListMessagesOptions::default()) + // Bo adds a member while 3 epochs behind + bo_group + .add_members(vec![frankie.account_address.clone()]) + .await .unwrap(); bo_group.sync().await.unwrap(); - let bo_messages = bo_group - .find_messages(FfiListMessagesOptions::default()) - .unwrap(); - assert_eq!(bo_messages.len(), 9); - assert_eq!(alix_messages.len(), 10); + let bo_members = bo_group.list_members().unwrap(); + assert_eq!(bo_members.len(), 4); - assert_eq!( - bo_messages[bo_messages.len() - 1].id, - alix_messages[alix_messages.len() - 1].id - ); + alix_group.sync().await.unwrap(); + let alix_members = alix_group.list_members().unwrap(); + assert_eq!(alix_members.len(), 4); } // test is also showing intermittent failures with database locked msg diff --git a/xmtp_mls/src/groups/sync.rs b/xmtp_mls/src/groups/sync.rs index c146286c4..86b1863ca 100644 --- a/xmtp_mls/src/groups/sync.rs +++ b/xmtp_mls/src/groups/sync.rs @@ -239,7 +239,7 @@ impl MlsGroup { ); return false; } - return true; + true } #[allow(clippy::too_many_arguments)] From 3e479eb5cd1fac9725e003486bef2a5ebcbbfc00 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 24 Jul 2024 17:23:07 -0700 Subject: [PATCH 10/10] sync_until_all_intents_resolved -> sync_until_last_intent_resolved --- xmtp_mls/src/groups/mod.rs | 4 ++-- xmtp_mls/src/groups/sync.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xmtp_mls/src/groups/mod.rs b/xmtp_mls/src/groups/mod.rs index e8a4db420..c8e318204 100644 --- a/xmtp_mls/src/groups/mod.rs +++ b/xmtp_mls/src/groups/mod.rs @@ -444,7 +444,7 @@ impl MlsGroup { log::error!("Send: error publishing intents: {:?}", err); } - self.sync_until_all_intents_resolved(conn, client).await?; + self.sync_until_last_intent_resolved(conn, client).await?; message_id } @@ -462,7 +462,7 @@ impl MlsGroup { self.maybe_update_installations(conn.clone(), update_interval, client) .await?; self.publish_intents(conn.clone(), client).await?; - self.sync_until_all_intents_resolved(conn, client).await?; + self.sync_until_last_intent_resolved(conn, client).await?; Ok(()) } diff --git a/xmtp_mls/src/groups/sync.rs b/xmtp_mls/src/groups/sync.rs index 86b1863ca..6801d4b25 100644 --- a/xmtp_mls/src/groups/sync.rs +++ b/xmtp_mls/src/groups/sync.rs @@ -134,7 +134,7 @@ impl MlsGroup { Ok(()) } - pub(super) async fn sync_until_all_intents_resolved( + pub(super) async fn sync_until_last_intent_resolved( &self, conn: DbConnection, client: &Client,