Skip to content

fix(relay): include event kind in HTTP bridge success attribution log - #4698

Open
santhiprakash wants to merge 2 commits into
block:mainfrom
santhiprakash:fix/est-1795-bridge-log-kind
Open

fix(relay): include event kind in HTTP bridge success attribution log#4698
santhiprakash wants to merge 2 commits into
block:mainfrom
santhiprakash:fix/est-1795-bridge-log-kind

Conversation

@santhiprakash

Copy link
Copy Markdown

Summary

  • Adds kind: u32 to SubmitOutcome::Ok in crates/buzz-relay/src/api/bridge.rs.
  • Populates it from the existing kind_u32 local computed by buzz_core::kind::event_kind_u32(&event) in submit_event_authed.
  • Logs kind in the SubmitOutcome::Ok tracing::info! arm, mirroring the existing SubmitOutcome::Rejected arm.
  • Adds a focused regression test (submit_event_text_note_includes_kind_in_attribution_line) that drives a real POST /events and asserts the accepted attribution line contains kind=1.

Fixes #4676.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p buzz-relay --lib -- --ignored submit_event_ (5 tests, including new regression test, with local Postgres + Redis)
  • just ci — blocked in this environment by a missing glib-2.0 system package required for desktop-tauri-clippy (pkg-config cannot find glib-2.0). The Rust workspace checks and targeted relay tests pass.

extract_channel_id_from_filter previously returned the first parseable UUID from a multi-value #h tag, so a POST /query filter listing multiple channel UUIDs silently collapsed to whichever channel sorted first. NIP-01 treats a multi-value tag as OR, so the filter must be handled by the Rust-side filters_match post-filter instead of being pinned to a single channel_id SQL predicate.

Match the existing guard in bridge.rs::extract_channel_from_filter and the WS REQ path: only set channel_id when the filter contains exactly one #h value and it is a parseable UUID. Add focused regression tests.

Fixes block#4659

Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
@santhiprakash
santhiprakash requested a review from a team as a code owner August 4, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relay logs omit event.kind, making publish failures indistinguishable from success

1 participant