-
Notifications
You must be signed in to change notification settings - Fork 48
fix: parameter to _onPeerDisconnected #58
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
Conversation
`_onPeerDisconnected` is expecting a `PeerInfo` but it was being passed a pubsub `Peer`. I'm not sure if this is the correct fix but it resolves this error for me: ``` (node:77189) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toB58String' of undefined at GossipSub._onPeerDisconnected (/Users/alan/Code/pl/ipfs/js-ipfs/node_modules/libp2p-pubsub/src/index.js:190:34) at GossipSub._processMessages (/Users/alan/Code/pl/ipfs/js-ipfs/node_modules/libp2p-gossipsub/src/pubsub.js:120:12) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:94:5) ```
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
=========================================
+ Coverage 83.6% 83.81% +0.2%
=========================================
Files 8 8
Lines 482 482
=========================================
+ Hits 403 404 +1
+ Misses 79 78 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, can you just add a test where the process message throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! I went ahead and created a PR at libp2p-pubsub
to correct the jsdocs there for _processMessage, libp2p/js-libp2p-pubsub#35.
@wemeetagain can this fix be merged and released? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the ping
test has been added as requested
@wemeetagain any chance this can get released under the "beta" tag? |
_onPeerDisconnected
is expecting aPeerInfo
but it was being passed a pubsubPeer
.I'm not sure if this is the correct fix but it resolves this error for me: