Skip to content

docs(nostr): document #h requirement for live reaction subscriptions - #3487

Merged
tlongwell-block merged 2 commits into
block:mainfrom
Zigoljube:docs/reaction-subscription-h-tag
Aug 1, 2026
Merged

docs(nostr): document #h requirement for live reaction subscriptions#3487
tlongwell-block merged 2 commits into
block:mainfrom
Zigoljube:docs/reaction-subscription-h-tag

Conversation

@Zigoljube

Copy link
Copy Markdown
Contributor

What this fixes

fan_out_scoped (crates/buzz-relay/src/subscription.rs:278-394) enforces a deliberate, symmetric scoping invariant — documented in the code itself:

Global subscriptions (channel_id = None) do NOT receive channel-scoped events. Channel-scoped subscriptions do NOT receive global events.

The relay derives a reaction's stored channel from its #e target at ingest — client-supplied #h is ignored for channel determination (NOSTR.md:50 documents this for writing). The consequence for reading is that every reaction is a channel-scoped event, so a live subscription {"kinds":[7]} without #h is a global subscription and silently receives no reactions at all — no error, no CLOSED, just nothing. The working form is {"kinds":[7],"#h":["<channel-uuid>"]}, and it works regardless of how the reaction was signed: explicit h tags on the event are matched directly, and tagless reactions match via the stored channel fallback (crates/buzz-core/src/filter.rs:78-91 — fallback applies only when the event has no h tags; explicit tags are authoritative).

NOSTR.md already documents this exact pitfall for group-metadata events:

Note: Channel-scoped storage means live global subscriptions ({kinds:[39000]}) won't receive these via fan-out. (NOSTR.md:124-126)

…but has no equivalent note for reactions, which is the case a bot/integration author is far more likely to hit: any client that wants to observe approvals/reactions live (workflow reaction-triggers make this a first-class pattern in Buzz) will naturally try a kinds-only REQ first and conclude reactions are broken. We lost real debugging time to exactly this while building a headless integration (https://github.com/OriginTrail/buzz-dkg-integration); the behavior is by design, only the docs are missing.

What this PR changes

Docs only (NOSTR.md): a subscribe-to-reactions example in "Sending Messages", plus one note mirroring the existing 39000 note. No code changes.

How to verify

  • Behavior: with the relay running, open a live REQ {"kinds":[7]} (no #h) and react to a channel message from another client → nothing is delivered; re-subscribe with {"kinds":[7],"#h":["<channel-uuid>"]} → the reaction arrives.
  • Claims against code (verified at 485d03a): scoping invariant crates/buzz-relay/src/subscription.rs:386-393; channel derivation derive_reaction_channel() in crates/buzz-relay/src/handlers/ingest.rs; #h fallback crates/buzz-core/src/filter.rs:78-91 and its test h_tag_fallback_uses_stored_channel_id.

Duplicate search: no existing issue/PR found for reactions subscription, fan-out kinds (searched 2026-07-29). DCO signed-off.

The relay derives a reaction's channel from its #e target, making
reactions channel-scoped events; live fan-out keeps channel-scoped and
global subscriptions strictly separate, so a kinds-only {"kinds":[7]}
subscription silently receives no reactions. NOSTR.md documents this
pitfall for kind:39000 but not for kind:7, which is the case headless
integrations hit first. Add a subscribe example and a note mirroring
the existing 39000 note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Žiga Drev <ziga.drev@gmail.com>
@Zigoljube
Zigoljube requested a review from a team as a code owner July 29, 2026 07:55
@cameronhotchkies cameronhotchkies added the triage-ready Appropriate for agentic review label Jul 30, 2026
Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@buzz.block.builderlab.xyz>
Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@buzz.block.builderlab.xyz>
@tlongwell-block

Copy link
Copy Markdown
Collaborator

Thanks for the contribution, @Zigoljube! 🐝

@tlongwell-block
tlongwell-block merged commit 756dd7f into block:main Aug 1, 2026
3 checks passed
tellaho added a commit that referenced this pull request Aug 1, 2026
* origin/main: (24 commits)
  perf(relay): serve relay-membership checks from the read replica (#4124)
  chore(deps): bump nostr-relay-pool for RUSTSEC-2026-0224 (#4139)
  docs(nostr): document #h requirement for live reaction subscriptions (#3487)
  docs(chart): fix ArgoCD example for native OCI sources (full artifact repoURL + path) (#3426)
  docs(readme): clarify which release asset to download per platform (#3481)
  fix(relay): allow open relays to set their NIP-11 workspace icon (kind:9033) (#3998)
  docs: note that addressable channel events scope by d, not h (#4103)
  docs: fix stale kind count, quick-start numbering, and empty Further Reading (#2613)
  fix(desktop): keep thread-open affordance in archived channels (#4012)
  docs: add one-click Railway deploy for a hosted relay (#2733)
  fix(desktop): point Oh My Pi preset at omp.sh (#3516)
  fix(mesh): stop restarting a busy or loading shared-compute node (#3909)
  fix(desktop): preserve first huddle speech (#3962)
  feat(desktop): Agent Trading Cards — mintable agent-snapshot card PNGs with optional NIP-44 lock (#3278)
  fix(buzz-acp): thread cache-read tokens into NIP-AM kind:44200 events (#3999)
  feat(relay): accept kind:30621 multi-repo projects at ingest (#3171)
  fix(release): preserve main in desktop PR body (#3979)
  chore(release): release Buzz Desktop version 0.5.3 (#3972)
  fix(release): require exact-head approval for desktop tags (#3973)
  fix(release): make desktop tagging squash-safe (#3965)
  ...

Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tellaho added a commit that referenced this pull request Aug 1, 2026
…onfig

* origin/main:
  perf(relay): serve relay-membership checks from the read replica (#4124)
  chore(deps): bump nostr-relay-pool for RUSTSEC-2026-0224 (#4139)
  docs(nostr): document #h requirement for live reaction subscriptions (#3487)
  docs(chart): fix ArgoCD example for native OCI sources (full artifact repoURL + path) (#3426)
  docs(readme): clarify which release asset to download per platform (#3481)
  fix(relay): allow open relays to set their NIP-11 workspace icon (kind:9033) (#3998)
  docs: note that addressable channel events scope by d, not h (#4103)
  docs: fix stale kind count, quick-start numbering, and empty Further Reading (#2613)
  fix(desktop): keep thread-open affordance in archived channels (#4012)
  docs: add one-click Railway deploy for a hosted relay (#2733)
  fix(desktop): point Oh My Pi preset at omp.sh (#3516)
  fix(mesh): stop restarting a busy or loading shared-compute node (#3909)
  fix(desktop): preserve first huddle speech (#3962)
  feat(desktop): Agent Trading Cards — mintable agent-snapshot card PNGs with optional NIP-44 lock (#3278)
  fix(buzz-acp): thread cache-read tokens into NIP-AM kind:44200 events (#3999)
  feat(relay): accept kind:30621 multi-repo projects at ingest (#3171)
  fix(release): preserve main in desktop PR body (#3979)
  chore(release): release Buzz Desktop version 0.5.3 (#3972)
  fix(release): require exact-head approval for desktop tags (#3973)
  fix(release): make desktop tagging squash-safe (#3965)

Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tellaho added a commit that referenced this pull request Aug 2, 2026
- Incorporate upstream desktop changes required by the pre-push overlap guard
- Preserve the link preview thumbnail stabilization work on the updated base

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>

* origin/main: (26 commits)
  docs: formal spec for remote agents and their management (#3748)
  fix(nip-oa): accept raw Nostr tag form in parse_json_array (#4203)
  perf(relay): serve relay-membership checks from the read replica (#4124)
  chore(deps): bump nostr-relay-pool for RUSTSEC-2026-0224 (#4139)
  docs(nostr): document #h requirement for live reaction subscriptions (#3487)
  docs(chart): fix ArgoCD example for native OCI sources (full artifact repoURL + path) (#3426)
  docs(readme): clarify which release asset to download per platform (#3481)
  fix(relay): allow open relays to set their NIP-11 workspace icon (kind:9033) (#3998)
  docs: note that addressable channel events scope by d, not h (#4103)
  docs: fix stale kind count, quick-start numbering, and empty Further Reading (#2613)
  fix(desktop): keep thread-open affordance in archived channels (#4012)
  docs: add one-click Railway deploy for a hosted relay (#2733)
  fix(desktop): point Oh My Pi preset at omp.sh (#3516)
  fix(mesh): stop restarting a busy or loading shared-compute node (#3909)
  fix(desktop): preserve first huddle speech (#3962)
  feat(desktop): Agent Trading Cards — mintable agent-snapshot card PNGs with optional NIP-44 lock (#3278)
  fix(buzz-acp): thread cache-read tokens into NIP-AM kind:44200 events (#3999)
  feat(relay): accept kind:30621 multi-repo projects at ingest (#3171)
  fix(release): preserve main in desktop PR body (#3979)
  chore(release): release Buzz Desktop version 0.5.3 (#3972)
  ...

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants