diff --git a/changelog.md b/changelog.md
index cf15544..7b2d622 100644
--- a/changelog.md
+++ b/changelog.md
@@ -6,6 +6,7 @@ This means the whole API has changed. Even though semantics are the same
the mechanism is now different and requires new implementation to use properly.
* Split checksum events into finalize and verify
* Add `base_dir` field in the `RequestQueued` event files
+* Fix rare issue of missing receiver's in-progress events
---
diff --git a/drop-transfer/src/ws/server/handler.rs b/drop-transfer/src/ws/server/handler.rs
index 4445333..2e35921 100644
--- a/drop-transfer/src/ws/server/handler.rs
+++ b/drop-transfer/src/ws/server/handler.rs
@@ -60,6 +60,7 @@ pub trait HandlerLoop {
async fn on_bin_msg(&mut self, ws: &mut WebSocket, bytes: Vec) -> anyhow::Result<()>;
async fn finalize_success(self);
+ async fn finalize_failure(self);
}
pub trait Request {
diff --git a/drop-transfer/src/ws/server/mod.rs b/drop-transfer/src/ws/server/mod.rs
index ce0217b..769f516 100644
--- a/drop-transfer/src/ws/server/mod.rs
+++ b/drop-transfer/src/ws/server/mod.rs
@@ -564,6 +564,7 @@ impl RunContext<'_> {
"WS connection broke for {}: {err:?}",
xfer.id()
);
+ handler.finalize_failure().await;
} else {
info!(self.logger, "Sucesfully finalizing transfer loop");
handler.finalize_success().await;
diff --git a/drop-transfer/src/ws/server/v2.rs b/drop-transfer/src/ws/server/v2.rs
index e5b1fb8..7180347 100644
--- a/drop-transfer/src/ws/server/v2.rs
+++ b/drop-transfer/src/ws/server/v2.rs
@@ -226,6 +226,18 @@ impl HandlerLoop<'_, PING> {
self.stop_task(&file_id, Status::FileRejected).await;
}
}
+
+ fn take_pause_futures(&mut self) -> impl Future