buzz_sdk::build_add_member fails for self-targeted grants (missing p tag)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start at buzz_sdk::build_add_member and trace the EventBuilder::new(...).tags([h, p, role]) path used by buzz-cli channels add-member; reproduce the self-targeted command from the issue. The fix is done when the self-targeted event retains its p tag and the relay accepts it, while non-self targets continue to work.
Written by the indexing model from the issue text.
Description
Summary
buzz_sdk::build_add_member (used by buzz-cli channels add-member) builds its kind:9000 event via a plain EventBuilder::new(...).tags([h, p, role]) without calling .allow_self_tagging(). The nostr crate's EventBuilder strips any p tag matching the signer's own pubkey by default (documented behavior — allow_self_tagging() exists precisely to opt out), so a self-targeted add-member call (e.g. an owner explicitly granting themselves membership on a channel they didn't get auto-added to — see block/buzz#6240) silently loses its p tag before signing.
The relay then rejects the resulting event with a confusing invalid: missing p tag — which reads as if the CLI passed a bad --pubkey, when actually the tag was present in the builder and was stripped later, invisibly, during signing.
Repro
buzz channels add-member --channel <id> --pubkey <own-pubkey> --role admin
# → {"error":"relay_error","message":"relay error 400: invalid: missing p tag","retryable":false}
The identical call with a different (non-self) target pubkey succeeds normally.
Suggested fix
In buzz_sdk::build_add_member (and any other builder in buzz-sdk that constructs a structural/administrative p tag rather than a social "mention"), call .allow_self_tagging() before signing, since these aren't NIP-10-style mention tags and self-targeting is a legitimate, expected case.
Found while working around block/buzz#6240.
- Dominant language
- Rust
- Stars
- 33.7k
- Forks
- 4.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 239
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from block/buzz
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
workflow_sink's mention parser never masks code regions — @name inside a code span wakes the agent Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 Half a day Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100