Skip to content

[FEAT] Return error when publishing with no relay connections #52

@BenGWeeks

Description

@BenGWeeks

Description

When an extension (like nostrmarket) publishes an event via nostrclient's internal websocket, nostrclient currently accepts the event even if there are no relay connections configured or active.

This makes it impossible for the calling extension to know if the message was actually delivered to any relays.

Current Behavior

  1. Extension sends event to nostrclient via internal WS
  2. nostrclient accepts the event (internal WS is open)
  3. Event goes nowhere because no relays are configured
  4. Extension thinks message was sent successfully

Proposed Behavior

When publish_nostr_event is called and there are no active relay connections:

  • Return an error response indicating no relays available
  • Or expose a status endpoint that extensions can query to check relay connectivity

Use Case

In nostrmarket (#134), we want to show users when their direct messages failed to send. We can detect when nostrclient's websocket is completely unavailable, but not when nostrclient is running with zero relay connections.

Related

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