Skip to content

Commit

Permalink
fix: don't dump messages just because something was removed from the …
Browse files Browse the repository at this point in the history
…pending replies box
  • Loading branch information
Xaeroxe committed Jan 2, 2023
1 parent 4155015 commit 5bbf7a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "async-io-converse"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Can conduct a conversation over any AsyncRead or AsyncWrite type with serde compatible types"
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin, T: Serialize + DeserializeOwne
while let Ok(reply_data) = reply_data_receiver.try_recv() {
pending_reply.push(reply_data);
}
let start_len = pending_reply.len();
let mut user_message = Some(i.user_message);
pending_reply.retain_mut(|pending_reply| {
if let Some(reply_sender) = pending_reply.reply_sender.as_ref() {
Expand All @@ -218,7 +217,7 @@ impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin, T: Serialize + DeserializeOwne
}
!matches
});
if start_len == pending_reply.len() {
if !i.is_reply {
return Poll::Ready(Some(Ok(ReceivedMessage {
message: Some(user_message.take().expect("infallible")),
conversation_id: i.conversation_id,
Expand Down

0 comments on commit 5bbf7a8

Please sign in to comment.