Closed noot closed 5 years ago
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!
Resolved by #302 via 679d446daa0b43c5a1d77c8f300b34c32c678022
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!