Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mc/thread-safe-groups' into mc/t…
Browse files Browse the repository at this point in the history
…hread-safe-groups
  • Loading branch information
mchenani committed Dec 17, 2024
2 parents e02b70b + 948012f commit ae6c21e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions xmtp_mls/src/groups/device_sync/preference_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ mod tests {
use super::*;
use crate::{
builder::ClientBuilder,
groups::scoped_client::ScopedGroupClient,
storage::consent_record::{ConsentState, ConsentType},
};
use crypto_utils::generate_local_wallet;
Expand Down Expand Up @@ -158,5 +159,13 @@ mod tests {
let pref_b = StoredUserPreferences::load(amal_b_conn).unwrap();

assert_eq!(pref_a.hmac_key, pref_b.hmac_key);

amal_a
.revoke_installations(vec![amal_b.installation_id().to_vec()])
.await
.unwrap();

let new_pref_a = StoredUserPreferences::load(amal_a_conn).unwrap();
assert_ne!(pref_a.hmac_key, new_pref_a.hmac_key);
}
}
8 changes: 7 additions & 1 deletion xmtp_mls/src/identity_updates.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::storage::association_state::StoredAssociationState;
use crate::storage::{
association_state::StoredAssociationState, user_preferences::StoredUserPreferences,
};
use futures::future::try_join_all;
use std::collections::{HashMap, HashSet};
use thiserror::Error;
Expand Down Expand Up @@ -350,6 +352,10 @@ where
)
}

// Cycle the HMAC key
let conn = self.store().conn()?;
StoredUserPreferences::new_hmac_key(&conn, &self.local_events)?;

Ok(builder.build())
}

Expand Down

0 comments on commit ae6c21e

Please sign in to comment.