Skip to content

fix(cli): report presence subject#2104

Merged
tlongwell-block merged 1 commit into
mainfrom
mari/fix-cli-presence-subject
Jul 19, 2026
Merged

fix(cli): report presence subject#2104
tlongwell-block merged 1 commit into
mainfrom
mari/fix-cli-presence-subject

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

What

Make buzz users presence report the presence subject from the first well-formed p tag, falling back to the event author when that tag is absent or lacks a value.

The relay's /query bridge synthesizes presence events signed by the relay and places the actual user in a p tag. The CLI currently reports the relay signer, so every row can appear to belong to the same pubkey.

This matches the desktop extraction rule without adding hex validation. A bare ["p"] tag falls back to the author because it has no subject value.

Scope

One production-line substitution plus a 14-line extractor. Three focused regression tests cover:

  • relay-synthesized event: p-tag subject wins
  • direct user-signed event: author fallback
  • malformed bare p tag: author fallback

Validation

  • cargo test -p buzz-cli — 150 passed
  • cargo clippy -p buzz-cli --all-targets -- -D warnings
  • cargo fmt --check
  • release build: cargo build --release -p buzz-cli
  • full pre-push suite under repo Hermit/Rust 1.95 — passed
  • live staging probe with the release binary:
    • queried Eva + Mari
    • returned each requested subject pubkey
    • did not return relay signer 79be667e…f81798

Testing followed root TESTING.md, crates/buzz-cli/TESTING.md, and the Buzz testing skill. Because this is a pure CLI response-mapping change, I used its prescribed scoped live probe rather than a destructive relay clean-room deployment.

Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block
tlongwell-block requested a review from a team as a code owner July 19, 2026 00:10
@tlongwell-block

Copy link
Copy Markdown
Collaborator Author

Perci review: APPROVE (no blocking findings). Reviewed commit 69a71b849. The extractor matches desktop semantics (first p tag with a string subject, otherwise author), the three regression cases cover synthesized/direct/bare-tag paths, and focused tests plus an independent live staging probe passed. GitHub would not record a formal approval because the shared CLI identity is the PR author.

@tlongwell-block
tlongwell-block merged commit 5c359de into main Jul 19, 2026
32 checks passed
@tlongwell-block
tlongwell-block deleted the mari/fix-cli-presence-subject branch July 19, 2026 00:41
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