-
-
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.
fix: return correct MsgId for malformed message tombstone
.execute() returns the number of affected rows, in this case it is always 1 and MsgId(1) is returned instead of the actual tombstone row ID.
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 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
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 |
---|---|---|
|
@@ -322,7 +322,7 @@ async fn test_no_from() { | |
let chats = Chatlist::try_load(&t, 0, None, None).await.unwrap(); | ||
assert!(chats.get_msg_id(0).is_err()); | ||
|
||
receive_imf( | ||
let received = receive_imf( | ||
context, | ||
b"Received: (Postfix, from userid 1000); Mon, 4 Dec 2006 14:51:39 +0100 (CET)\n\ | ||
To: [email protected]\n\ | ||
|
@@ -335,8 +335,13 @@ async fn test_no_from() { | |
false, | ||
) | ||
.await | ||
.unwrap() | ||
.unwrap(); | ||
|
||
// Check that tombstone MsgId is returned. | ||
assert_eq!(received.msg_ids.len(), 1); | ||
assert!(!received.msg_ids[0].is_special()); | ||
|
||
let chats = Chatlist::try_load(&t, 0, None, None).await.unwrap(); | ||
// Check that the message is not shown to the user: | ||
assert!(chats.is_empty()); | ||
|