Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PublishError.InsufficientPeers a bit more self-explanatory? #472

Closed
achingbrain opened this issue Nov 26, 2023 · 0 comments · Fixed by #487 or #492
Closed

Make PublishError.InsufficientPeers a bit more self-explanatory? #472

achingbrain opened this issue Nov 26, 2023 · 0 comments · Fixed by #487 or #492

Comments

@achingbrain
Copy link
Collaborator

A recurring question that comes up is:

I get PublishError.InsufficientPeers but I have plenty of peers, what gives?

The error does not mean you don't have peers, it means you don't have any peers listening on the pubsub topic you are trying to publish on.

If this was changed to PublishError.InsufficientTopicPeers or even something like PublishError.InsufficientPeersSubscribedToTopic it might be a bit clearer for people?

achingbrain added a commit that referenced this issue Feb 2, 2024
People continually mistake the `InsufficientPeers` error for something
that can be "worked around" by setting `allowPublishToZeroPeers` to true,
and they then expect other network nodes to still recieve their messages.

This PR renames the option to `allowPublishToZeroTopicPeers` - this makes
it clear(er) that it's not that you don't have any peers, it's that no
peers you have are listening on the topic.

It also improves the JSDoc comment on the option and changes the `Error`
message from `PublishError.InsufficientPeers` to `PublishError.NoPeersSubscribedToTopic`
which (I hope) more accurately describes what's wrong.

BREAKING CHANGE: The `allowPublishToZeroPeers` option has been renamed to `allowPublishToZeroTopicPeers`

Fixes #472
wemeetagain pushed a commit that referenced this issue Feb 27, 2024
People continually mistake the `InsufficientPeers` error for something
that can be "worked around" by setting `allowPublishToZeroPeers` to true,
and they then expect other network nodes to still recieve their messages.

This PR renames the option to `allowPublishToZeroTopicPeers` - this makes
it clear(er) that it's not that you don't have any peers, it's that no
peers you have are listening on the topic.

It also improves the JSDoc comment on the option and changes the `Error`
message from `PublishError.InsufficientPeers` to `PublishError.NoPeersSubscribedToTopic`
which (I hope) more accurately describes what's wrong.

BREAKING CHANGE: The `allowPublishToZeroPeers` option has been renamed to `allowPublishToZeroTopicPeers`

Fixes #472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant