Skip to content

Commit

Permalink
fix: mark cancellation as failure if action reaches completion
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed Jun 13, 2024
1 parent af57577 commit 16a75d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uplink/src/base/bridge/actions_lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,13 @@ impl ActionsBridge {
if let Some(CurrentAction { cancelled_by: Some(cancel_action), .. }) =
self.current_action.take()
{
let response = ActionResponse::success(&cancel_action);
self.streams.forward(response).await;
if response.is_failed() {
let response = ActionResponse::success(&cancel_action);
self.streams.forward(response).await;
} else {
// Marks the cancellation as a failure as action has reached completion without being cancelled
self.forward_action_error(&cancel_action, Error::FailedCancellation).await
}
}
return;
}
Expand Down

0 comments on commit 16a75d1

Please sign in to comment.