diff --git a/crates/sdk/src/workflow_context.rs b/crates/sdk/src/workflow_context.rs index 8f751971d..ad36d06e5 100644 --- a/crates/sdk/src/workflow_context.rs +++ b/crates/sdk/src/workflow_context.rs @@ -1121,7 +1121,7 @@ impl WorkflowContext { pub fn wait_condition<'a>( &'a self, mut condition: impl FnMut(&W) -> bool + 'a, - ) -> impl Future + 'a { + ) -> impl FusedFuture + 'a { future::poll_fn(move |cx: &mut Context<'_>| { if condition(&*self.workflow_state.borrow()) { Poll::Ready(()) @@ -1130,6 +1130,7 @@ impl WorkflowContext { Poll::Pending } }) + .fuse() } }