Skip to content

Commit

Permalink
Handling of own messages (#334)
Browse files Browse the repository at this point in the history
* Handle own commits

* Refactor a bit

* Clean up

* Fix incorrect test

* One more debug statement

* Clean up tests

* Fix test that no longer needs manual committing

* Fix other test that no longer needs manual commit

* Pending commit is now merged. Test should reflect that

* Address PR feedback on error handling
  • Loading branch information
neekolas authored Nov 15, 2023
1 parent 09a2442 commit 2b3e0c3
Show file tree
Hide file tree
Showing 2 changed files with 253 additions and 93 deletions.
16 changes: 0 additions & 16 deletions xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,28 +301,12 @@ mod tests {
let bob = ClientBuilder::new_test_client(generate_local_wallet().into()).await;
bob.register_identity().await.unwrap();

let conn = &mut alice.store.conn().unwrap();
let alice_bob_group = alice.create_group().unwrap();
alice_bob_group
.add_members_by_installation_id(vec![bob.installation_public_key()])
.await
.unwrap();

// Manually mark as committed
// TODO: Replace with working synchronization once we can add members end to end
let intents = alice
.store
.find_group_intents(conn, alice_bob_group.group_id.clone(), None, None)
.unwrap();
let intent = intents.first().unwrap();
// Set the intent to committed manually
alice
.store
.set_group_intent_committed(conn, intent.id)
.unwrap();

alice_bob_group.post_commit(conn).await.unwrap();

let bob_received_groups = bob.sync_welcomes().await.unwrap();
assert_eq!(bob_received_groups.len(), 1);
assert_eq!(
Expand Down
Loading

0 comments on commit 2b3e0c3

Please sign in to comment.