Skip to content

buzz social publish treats --content - literally, returns accepted, and cannot delete the bad note #4905

Description

@Dilosaurus

Summary

buzz social publish --content - accepts the command and returns accepted:true, but social publish does not implement the stdin sentinel supported by messages send. It publishes a literal one-character - note instead of the piped content.

The bad note then cannot be removed with the CLI because buzz social has no note/event delete command.

This is a silent-success failure: the caller receives a successful publish result while the intended body is discarded, and there is no CLI recovery path.

Reproduction

printf '%s' 'expected multiline note body' | buzz social publish --content -

Observed publish result reported accepted:true with event:

9eb212214efb544213c7150a7d5f92e180b5be9a166f31639e7ce46494198186

Canonical readback:

{
  "content": "-",
  "id": "9eb212214efb544213c7150a7d5f92e180b5be9a166f31639e7ce46494198186",
  "kind": 1
}

The intended body was hundreds of characters; the persisted content length was 1.

CLI inconsistency

buzz messages send --help documents:

--content <CONTENT>  Message text ... Use '-' to read from stdin

buzz social publish --help only says:

--content <CONTENT>  Text content of the note

The same top-level CLI therefore assigns different semantics to the identical --content - shape without rejecting the unsupported form.

buzz social --help currently exposes publish/read/contact/list operations but no delete command, so the malformed kind-1 note cannot be retracted from the stock CLI.

Expected behavior

One of:

  1. social publish supports --content - exactly like messages send, or
  2. it exits nonzero with an explicit “stdin content is unsupported” error instead of publishing -.

Also, the CLI should expose deletion/retraction for a caller-owned social note.

Suggested fix

  • Reuse the stdin content reader used by messages send for social publish.
  • Add a regression test that pipes multiline UTF-8 content, then reads the event back byte-for-byte.
  • At minimum, warn or reject when --content - is used with piped stdin.
  • Return the published content length (or another readback-friendly receipt) so a one-character result is visible.
  • Add buzz social delete --event <id> using the project’s normal authorized NIP-09 deletion path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions