mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
fix: Reset message error when scheduling resending (#5119)
Before, while a message is in OutPending state after resending is requested, the user still sees the red marker with error and it is confusing, so the user don't know the sending state of the message.
This commit is contained in:
@@ -1663,7 +1663,8 @@ pub(crate) async fn update_msg_state(
|
||||
msg_id: MsgId,
|
||||
state: MessageState,
|
||||
) -> Result<()> {
|
||||
let error_subst = match state >= MessageState::OutDelivered {
|
||||
ensure!(state != MessageState::OutFailed, "use set_msg_failed()!");
|
||||
let error_subst = match state >= MessageState::OutPending {
|
||||
true => ", error=''",
|
||||
false => "",
|
||||
};
|
||||
|
||||
@@ -689,6 +689,9 @@ async fn test_resend_after_ndn() -> Result<()> {
|
||||
)
|
||||
.await;
|
||||
chat::resend_msgs(&t, &[msg_id]).await?;
|
||||
let msg = Message::load_from_db(&t, msg_id).await?;
|
||||
assert_eq!(msg.state, MessageState::OutPending);
|
||||
assert_eq!(msg.error(), None);
|
||||
// Alice receives a BCC-self copy of their message.
|
||||
receive_imf(
|
||||
&t,
|
||||
|
||||
Reference in New Issue
Block a user