-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Order of messages if Sentbox is synced before Inbox
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4691,6 +4691,40 @@ async fn test_protected_group_add_remove_member_missing_key() -> Result<()> { | |
Ok(()) | ||
} | ||
|
||
/// Alice is offline for some time. | ||
/// When she comes online, first her sentbox is synced and then her inbox. | ||
/// This tests that the messages are still in the right order. | ||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_sync_sentbox_then_inbox() -> Result<()> { | ||
let alice = &TestContext::new_alice().await; | ||
let msg_sent = receive_imf( | ||
alice, | ||
b"From: [email protected]\n\ | ||
To: Bob <[email protected]>\n\ | ||
Message-ID: <[email protected]>\n\ | ||
Date: Sat, 09 Dec 2019 19:00:27 +0000\n\ | ||
\n\ | ||
Thanks, Bob!\n", | ||
true, | ||
) | ||
.await? | ||
.unwrap(); | ||
let msg_incoming = receive_imf( | ||
alice, | ||
b"From: Bob <[email protected]>\n\ | ||
To: [email protected]\n\ | ||
Message-ID: <[email protected]>\n\ | ||
Date: Sun, 08 Dec 2019 19:00:27 +0000\n\ | ||
\n\ | ||
Happy birthday, Alice!\n", | ||
true, | ||
) | ||
.await? | ||
.unwrap(); | ||
assert!(msg_incoming.sort_timestamp < msg_sent.sort_timestamp); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_dont_create_adhoc_group_on_member_removal() -> Result<()> { | ||
let mut tcm = TestContextManager::new(); | ||
|