add optional in_reply_to field on send for conversation threading
This commit is contained in:
parent
03db764101
commit
67b47872e0
9 changed files with 90 additions and 16 deletions
|
|
@ -378,6 +378,7 @@ async fn notify_manager_of_failure(socket: &Path, label: &str, err: &anyhow::Err
|
|||
&AgentRequest::Send {
|
||||
to: "manager".into(),
|
||||
body,
|
||||
in_reply_to: None,
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
|
|||
|
|
@ -314,6 +314,12 @@ pub struct SendArgs {
|
|||
pub to: String,
|
||||
/// Message body. Plain text; the broker doesn't parse it.
|
||||
pub body: String,
|
||||
/// Optional broker row-id of the message this is a reply to. Lets
|
||||
/// the dashboard render conversation threads. Pass the `id` from the
|
||||
/// `DeliveredMessage` you're responding to; omit for new threads.
|
||||
/// Silently ignored if the id is unknown or out of retention.
|
||||
#[serde(default)]
|
||||
pub in_reply_to: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
|
||||
|
|
@ -410,6 +416,7 @@ impl AgentServer {
|
|||
.dispatch(hive_sh4re::AgentRequest::Send {
|
||||
to: args.to,
|
||||
body: args.body,
|
||||
in_reply_to: args.in_reply_to,
|
||||
})
|
||||
.await;
|
||||
annotate_retries(format_ack(resp, "send", format!("sent to {to}")), retries)
|
||||
|
|
@ -802,6 +809,7 @@ impl ManagerServer {
|
|||
.dispatch(hive_sh4re::ManagerRequest::Send {
|
||||
to: args.to,
|
||||
body: args.body,
|
||||
in_reply_to: args.in_reply_to,
|
||||
})
|
||||
.await;
|
||||
annotate_retries(format_ack(resp, "send", format!("sent to {to}")), retries)
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ async fn notify(socket: &Path, to: &str, body: String) {
|
|||
let req = hive_sh4re::AgentRequest::Send {
|
||||
to: to.to_owned(),
|
||||
body,
|
||||
in_reply_to: None,
|
||||
};
|
||||
if let Err(e) = client::request::<_, hive_sh4re::AgentResponse>(socket, &req).await {
|
||||
tracing::warn!(error = ?e, "failed to notify {to} of plugin install failure");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue