Skip to content

fix(sdk,desktop): keep self-targeted p tags on issue assignment and the generic signer - #6516

Open
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:fix/allow-self-tagging-on-assignments
Open

fix(sdk,desktop): keep self-targeted p tags on issue assignment and the generic signer#6516
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:fix/allow-self-tagging-on-assignments

Conversation

@sumit-m

@sumit-m sumit-m commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fixes the self-referential p tag strip (#4326) at the point where it keeps
recurring, and covers the case that is visible in the UI.

What is broken today

In Buzz Desktop, open any task in a project and click Assign to me. Nothing
happens. Click Unassign on yourself and nothing happens either — the
operation reports success, a comment appears in the task's history reading
"Assigned this issue to …" / "Unassigned … from this task", and the Assignees
row is unchanged.

Assigning or unassigning anyone else works.

Why

Assignment is modelled as a kind:1 note whose p tags are the assignees.
nostr's EventBuilder::build_with_ctx removes any p tag matching the
author's public key unless allow_self_tagging() was called, so when the
assignee is the signer the published event carries no p tag at all. The
reducer that derives assignees from those notes then adds or removes nobody,
while the human-readable content still names the person.

The event id hashes over the tags that were actually signed, so this is not a
relay-side strip — the tag never existed on the wire.

What this changes

Three call sites, all of which build p tags as payload rather than as
mentions:

  • buzz-sdk: build_git_issue_assignee_operation — the assign/unassign
    builder used by the CLI and by Desktop's managed-owner path.
  • desktop: build_labeled_recipient_note_event — Desktop's labelled
    recipient notes, which also covers review requests.
  • desktop: the sign_event command — the generic signer used from the
    TypeScript side, which is the path the Assignees row actually goes through.

The third is the one worth arguing about, and I think it is the real defect. A
generic signing command's contract is to sign the tags it was given. Silently
discarding one makes it lie to every caller, and each new builder inherits the
trap — which is why this issue keeps being fixed one builder at a time
(#4975 merged for messages and forum notes; #4338, #4484, #3384 open for
membership and PR status). A caller that does not want a self p tag simply
does not add one.

Tests

Two regression tests in buzz-sdk, mirroring the existing
message_preserves_self_mention_p_tag pattern: a self-assignment and a
self-unassignment each keep the assignee's p tag through signing.

Verification

Reproduced and fixed against a local relay: before, clicking Assign to me
published an event with tags ["e", "a", "t", "prior"] and no assignee
appeared; after, the same click keeps the p tag and the name sticks. Existing
events are not repaired — the reducer replays history, and those events
genuinely carry no assignee — so a task assigned before the fix needs
reassigning once.

nostr removes a p tag naming the event author unless allow_self_tagging is
set, so assigning or unassigning yourself published an event with no
assignee: the comment read "Assigned this issue to ..." while the list
stayed empty. Messages and forum comments already opted in; the assignment
and recipient-note builders and the generic signer did not.

Signed-off-by: sumit-m <33051892+sumit-m@users.noreply.github.com>
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.

1 participant