Skip to content

Publish doesn't publish to current peerΒ #172

@rijkvanzanten

Description

@rijkvanzanten

Environment

[email protected]

[email protected]
  β†’ h3@@1.15.4
    β†’ [email protected]

Reproduction

Use peer.publish

Describe the bug

According to the documentation, peer.publish broadcasts a message to the subscribers of the given channel. However, I noticed that the peer that triggered the publish itself never received the message, even though it was subscribed to the channel.

Additional context

On closer look, it looks like this was implemented intentionally here:

if (peer !== this && peer._topics.has(topic)) {

as it explicitly checks if the peer isn't the current peer before sending the message. Not entirely sure if this is a bug or a 'feature'; depending on that this is either a bug report or a request for better documentation. Happy to open a PR for either of those :)

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions