fix(relay): include event kind in HTTP bridge success attribution log - #4698
Open
santhiprakash wants to merge 2 commits into
Open
fix(relay): include event kind in HTTP bridge success attribution log#4698santhiprakash wants to merge 2 commits into
santhiprakash wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kind: u32toSubmitOutcome::Okincrates/buzz-relay/src/api/bridge.rs.kind_u32local computed bybuzz_core::kind::event_kind_u32(&event)insubmit_event_authed.kindin theSubmitOutcome::Oktracing::info!arm, mirroring the existingSubmitOutcome::Rejectedarm.submit_event_text_note_includes_kind_in_attribution_line) that drives a realPOST /eventsand asserts the accepted attribution line containskind=1.Fixes #4676.
Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo 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 missingglib-2.0system package required fordesktop-tauri-clippy(pkg-configcannot find glib-2.0). The Rust workspace checks and targeted relay tests pass.