-
Notifications
You must be signed in to change notification settings - Fork 455
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
pubsub.unsubscribe should comply with interface-ipfs-core spec, since it links to it in the docs #300
Comments
Currently libp2p isn't actually doing anything with the callback, so you're never seeing the results. The unsubscribe is currently synchronous so the callback isn't actually needed, but we should add the callback since we're linking to the interface documents. The unsubscribe should be happening. If you add an interval based message broadcast you should see it stop after the unsubscribe timeout is called. setInterval(() => {
node2.pubsub.publish(topic,
Buffer.from('pomegranate'),
() => {}
)
}, 500) |
@jacobheun cool, looks like unsubscribe is working. thanks! |
fix linting issues pubsub.unsubscribe: check that callback is a function; removed timeout from tests remove console.log; add chai-checkmark move done to end of waterfall update pubsub test fix lint; remove unneeded waterfall
…bp2p#300) Create a private key object from the raw `Ed25519` private key and export it as a JWK to obtain the public key. Fixes libp2p#295
## [1.0.12](libp2p/js-libp2p-crypto@v1.0.11...v1.0.12) (2023-02-08) ### Bug Fixes * derive ed25519 public key from private key using node crypto ([libp2p#300](libp2p/js-libp2p-crypto#300)) ([874f820](libp2p/js-libp2p-crypto@874f820)), closes [libp2p#295](libp2p/js-libp2p-crypto#295) ### Trivial Changes * replace err-code with CodeError ([libp2p#293](libp2p/js-libp2p-crypto#293)) ([4398cf6](libp2p/js-libp2p-crypto@4398cf6)), closes [js-libp2p#1269](libp2p#1269)
Type: Bug
Severity: high
Description:
Cannot unsubscribe from a pubsub topic after subscribing. Following the IPFS core API here: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/PUBSUB.md
Steps to reproduce the error:
This code is from the IPFS core API as well as the libp2p pubsub tutorial. When running the code, you see that we successfully subscribe to the topic, and after waiting 1 second, we should also see an unsubscribe message. However this never happens.
Any help/feedback is much appreciated!
The text was updated successfully, but these errors were encountered: