mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
fix: Don't fail if going to send plaintext, but some peerstate is missing
F.e. this allows to reexecute Securejoin and fix the problem.
This commit is contained in:
@@ -179,6 +179,26 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_missing_peerstate_reexecute_securejoin() -> Result<()> {
|
||||
let mut tcm = TestContextManager::new();
|
||||
let alice = &tcm.alice().await;
|
||||
let alice_addr = alice.get_config(Config::Addr).await?.unwrap();
|
||||
let bob = &tcm.bob().await;
|
||||
enable_verified_oneonone_chats(&[alice, bob]).await;
|
||||
tcm.execute_securejoin(bob, alice).await;
|
||||
let chat = bob.get_chat(alice).await;
|
||||
assert!(chat.is_protected());
|
||||
bob.sql
|
||||
.execute("DELETE FROM acpeerstates WHERE addr=?", (&alice_addr,))
|
||||
.await?;
|
||||
tcm.execute_securejoin(bob, alice).await;
|
||||
let chat = bob.get_chat(alice).await;
|
||||
assert!(chat.is_protected());
|
||||
assert!(!chat.is_protection_broken());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_create_unverified_oneonone_chat() -> Result<()> {
|
||||
let mut tcm = TestContextManager::new();
|
||||
|
||||
Reference in New Issue
Block a user