Skip to content

Commit

Permalink
chore: fix more deadlocks (must be after "move functionalities to cli…
Browse files Browse the repository at this point in the history
…ent context)"
  • Loading branch information
SimonThormeyer committed Oct 10, 2024
1 parent e85aab1 commit 717a5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions crypto/src/e2e_identity/conversation_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,8 @@ mod tests {
let cb = Client::new_x509_credential_bundle(alice_cert.certificate.clone().into()).unwrap();
alice_central.context.e2ei_rotate(&id, &cb).await.unwrap();
alice_central.context.commit_accepted(&id).await.unwrap();

let mut alice_client_guard = alice_central.context.mls_client_mut().await.unwrap();
let alice_client = alice_client_guard.as_mut().unwrap();

let mut alice_client = alice_central.client().await;
let alice_provider = alice_central.context.mls_provider().await.unwrap();

// Needed because 'e2ei_rotate' does not do it directly and it's required for 'get_group_info'
Expand Down
7 changes: 4 additions & 3 deletions crypto/src/e2e_identity/rotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,8 @@ pub(crate) mod tests {
.await
.unwrap();
assert_eq!(old_cb, old_cb_found);
let mut alice_client_guard = alice_central.context.mls_client_mut().await.unwrap();
let (cid, all_credentials, scs, old_nb_identities) = {
let alice_client = alice_client_guard.as_ref().unwrap();
let alice_client = alice_central.client().await;
let old_nb_identities = alice_client
.identities
.iter()
Expand Down Expand Up @@ -659,9 +658,11 @@ pub(crate) mod tests {
let client = Client::load(backend, &cid, all_credentials, scs)
.await
.unwrap();
let mut alice_client_guard = alice_central.context.mls_client_mut().await.unwrap();
*alice_client_guard = Some(client);
drop(alice_client_guard);

let alice_client = alice_client_guard.as_ref().unwrap();
let alice_client = alice_central.client().await;

// Verify that Alice has the same credentials
let cb = alice_central
Expand Down

0 comments on commit 717a5c6

Please sign in to comment.