mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
fix(relay): log event kind on the HTTP bridge /events line (#5291)
The HTTP bridge request log recorded route, status, and accepted but not the event kind, so typing indicators (kind 7) and their deletions (kind 5) were indistinguishable from real messages (kind 9). Every agent turn produced accepted:true lines whether or not a message was actually sent, which twice led debuggers to conclude a silent agent had published successfully. Add kind to the Ok outcome and the tracing::info line so the publish path is self-describing without a database query. Closes #4676 Signed-off-by: Taksh <takshkothari09@gmail.com>
This commit is contained in:
@@ -654,12 +654,13 @@ pub async fn submit_event(
|
||||
submit_event_authed(&state, &tenant, &headers, &body, pubkey, event_id_bytes).await;
|
||||
|
||||
match &outcome {
|
||||
SubmitOutcome::Ok { accepted, .. } => {
|
||||
SubmitOutcome::Ok { accepted, kind, .. } => {
|
||||
tracing::info!(
|
||||
pubkey = %pubkey_hex,
|
||||
route = "/events",
|
||||
status = 200u16,
|
||||
accepted,
|
||||
kind,
|
||||
"HTTP bridge request"
|
||||
);
|
||||
}
|
||||
@@ -713,6 +714,7 @@ enum SubmitOutcome {
|
||||
/// Ingest pipeline ran and returned a result (accepted or not).
|
||||
Ok {
|
||||
accepted: bool,
|
||||
kind: u32,
|
||||
response: Json<Value>,
|
||||
},
|
||||
/// JSON parse failure before ingest — log category/line/column, not msg.
|
||||
@@ -843,6 +845,7 @@ async fn submit_event_authed(
|
||||
}));
|
||||
SubmitOutcome::Ok {
|
||||
accepted: result.accepted,
|
||||
kind: kind_u32,
|
||||
response,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user