Skip to content

Commit

Permalink
reload the group
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Jan 30, 2025
1 parent 7d29de0 commit be731a9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use xmtp_proto::xmtp::mls::api::v1::{welcome_message, GroupMessage, WelcomeMessa
#[cfg(any(test, feature = "test-utils"))]
use crate::groups::device_sync::WorkerHandle;

use crate::groups::{mls_ext::welcome_ext::DecryptedWelcome, ConversationListItem};
use crate::groups::{mls_ext::DecryptedWelcome, ConversationListItem};
use crate::{
api::ApiClientWrapper,
groups::{
Expand Down
4 changes: 3 additions & 1 deletion xmtp_mls/src/groups/mls_ext.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pub mod welcome_ext;
mod mls_ext_welcome;

pub(crate) use mls_ext_welcome::*;
File renamed without changes.
8 changes: 6 additions & 2 deletions xmtp_mls/src/groups/mls_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,13 @@ where
if !matches!(result, Err(StorageError::IntentionalRollback)) {
result?;
}

let processed_message = processed_message.expect("Was just set to Some")?;

// Reload the mlsgroup
let mls_group_reload = OpenMlsGroup::load(provider.storage(), mls_group.group_id())?
.expect("Mls group is currently loaded");
let _ = std::mem::replace(mls_group, mls_group_reload);

let (sender_inbox_id, sender_installation_id) =
extract_message_sender(mls_group, &processed_message, envelope_timestamp_ns)?;

Expand Down Expand Up @@ -601,7 +605,7 @@ where
};

provider.transaction(|provider| {
let processed_message = mls_group.process_message(provider, message)?;
// let processed_message = mls_group.process_message(provider, message)?;
let mut validated_commit = None;

if let ProcessedMessageContent::StagedCommitMessage(staged_commit) =
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod validated_commit;

use device_sync::preference_sync::UserPreferenceUpdate;
use intents::SendMessageIntentData;
use mls_ext::welcome_ext::build_group_join_config;
use mls_ext::build_group_join_config;
use mls_sync::GroupMessageProcessingError;
use openmls::{
credentials::CredentialType,
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/subscriptions/stream_conversations.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{LocalEvents, Result, SubscribeError};
use crate::{
groups::{mls_ext::welcome_ext::DecryptedWelcome, scoped_client::ScopedGroupClient, MlsGroup},
groups::{mls_ext::DecryptedWelcome, scoped_client::ScopedGroupClient, MlsGroup},
storage::{group::ConversationType, refresh_state::EntityKind, NotFound},
Client, XmtpOpenMlsProvider,
};
Expand Down

0 comments on commit be731a9

Please sign in to comment.