From aeca230859e5f556aa6a09007cda682a08c82542 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 8 Aug 2026 17:10:56 -0400 Subject: [PATCH] refactor(acp): delete publish_event_acked, only register_publish_ack is live The publish_event_acked method was dead code (#[allow(dead_code)], zero callers) with a hard-coded deadline that could not express the live path's min(fixed_publish_timeout, expiresAt) contract. Production ACK-gated publishing uses register_publish_ack exclusively. Remove the weaker parallel API. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- crates/buzz-acp/src/relay.rs | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/crates/buzz-acp/src/relay.rs b/crates/buzz-acp/src/relay.rs index 4efaaf35b..b8ff6f99c 100644 --- a/crates/buzz-acp/src/relay.rs +++ b/crates/buzz-acp/src/relay.rs @@ -624,33 +624,6 @@ impl RelayEventPublisher { .map_err(|_| RelayError::ConnectionClosed) } - /// Publish a signed event and await the relay's `OK` acknowledgement. - /// - /// Returns the [`AckOutcome`] once the background task resolves the waiter - /// (on `OK`, socket failure, or disconnect). The waiter is registered by - /// the background task **before** the EVENT frame is sent, satisfying the - /// registration-before-send contract. - /// - /// # Errors - /// Returns `RelayError::ConnectionClosed` if the command channel is closed - /// (background task has exited). - #[allow(dead_code)] - pub async fn publish_event_acked(&self, event: Event) -> Result { - let (ack_tx, ack_rx) = oneshot::channel(); - let deadline = tokio::time::Instant::now() - + std::time::Duration::from_secs(crate::acp::SENTINEL_PUBLISH_TIMEOUT_SECS); - self.cmd_tx - .send(RelayCommand::PublishEventAcked { - event: Box::new(event), - ack_tx, - deadline, - }) - .await - .map_err(|_| RelayError::ConnectionClosed)?; - // If the background task exits without resolving the waiter, treat as uncertain. - Ok(ack_rx.await.unwrap_or(AckOutcome::Uncertain)) - } - /// Register an ACK waiter for a signed event and return the receiver /// **without** awaiting the outcome. ///