Conversation
…ock#2568) Reaction events (NIP-25 kind 7) carried only an `e` tag for the target event, so relay-side notification filters keyed on `#p` never matched them. This adds the target event's author as a `p` tag. - `events::build_reaction`: accept an optional `target_author_pubkey` and emit a `["p", author]` tag when present (degrade: omit the tag, never fail the submit). - `add_reaction`: resolve the target event's author via a single `query_relay` lookup (same pattern as `remove_reaction`), then pass it through. On any lookup failure the reaction still submits without the tag. When the reactor IS the target author, nostr's build-step correctly drops the self-referential `p` tag. Scope: desktop persistent-reaction path only. The ephemeral ACP cosmetic reactions (👀/💬) and the CLI path are deliberately out of scope. Verified: cargo test events:: (57 pass, incl. 2 new p-tag tests), cargo check clean, cargo fmt clean. Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
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.
What
Fixes #2568 — reaction events (NIP-25 kind 7) only carried an
etag for the target event, so relay-side notification filters keyed on#pnever matched them. Adds the target event's author as aptag.Change
Scoped to the desktop persistent-reaction path (the exact case in the issue's repro — a user reacting to a message):
events::build_reaction— accept an optionaltarget_author_pubkeyand emit["p", author]when present. On aNoneauthor the tag is omitted and the submit still succeeds.add_reaction— resolve the target event's author with a singlequery_relaylookup (same pattern as the adjacentremove_reaction), then pass it to the builder. Any lookup failure degrades to a no-p-tag reaction rather than an error. When the reactor is the target author, nostr's build-step correctly drops the self-referentialptag (you don't notify yourself).Out of scope (deliberate)
The ephemeral ACP cosmetic reactions (👀/💬 flash reactions) and the CLI reaction path are unchanged — they are separate surfaces, and the issue's repro is specifically the user's desktop reaction. Widening those is a follow-up if wanted.
Verification
cargo test events::— 57 pass, incl. 2 new tests:reaction_carries_target_author_p_tag_when_knownreaction_omits_p_tag_when_author_unknowncargo check— cleancargo fmt --check— cleanSigned-off-by: Sarthak Singh sarthak.singh@juspay.in