Open zenineasa opened 1 year ago
Expected behavior.
From README.md:
peerInfo.topics
An Array of topics that this Peer is associated with --topics
will only be updated when the Peer is in client mode.
It seems like you've encountered an issue where peerInfoServer.topics.length
is not equal to 2
as expected in your test case. This might be due to a variety of reasons, such as a bug in the library, a race condition, or some other unexpected behavior.
Here are a few steps you might take to debug and resolve the issue:
peerInfoServer.topics
is being updated asynchronously and if you might be checking its length before it has been updated.brittle
.peerInfoServer
object at various points to ensure that it is being updated as expected.peerInfoServer.topics
might be being updated in parallel or overridden by other operations.If you've tried all of the above and are still encountering the issue, it might be worth reaching out to the library's maintainers or community for assistance, or even filing a bug report if you believe that the issue is due to a bug in the library.
When a swarm joins a topic as a server, the topic is not available at 'peerInfo.topics'. I have modified a testpoint to showcase the same.