Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

fix: pass subscriptions immediately on new peer connection #10

Merged
merged 4 commits into from
Dec 11, 2016

Conversation

gavinmcdermott
Copy link
Contributor

This fix ensures that a node's current subscriptions are immediately passed to a new peer when a connection is established.

@gavinmcdermott
Copy link
Contributor Author

gavinmcdermott commented Dec 10, 2016

Question @diasdavid: I was trying to figure a good way to test this...but the stream I imagine tapping is added as the peer connection is created. Is there an object or property somewhere, or a way to tap into the stream that I just don't know, that I could use to listen for that immediate write over the new stream?

The reason for this fix is referenced here.

@daviddias
Copy link
Member

Thank you @gavinmcdermott 🌟

A way to test this is:

  • Create 2 peers
  • Subscribe to a topic in one
  • Connect the two
  • Check if the other one has received the subscription by checking its peerSet

What do you think?

@gavinmcdermott
Copy link
Contributor Author

gavinmcdermott commented Dec 10, 2016

I did this last night, and it felt a little loose for some reason. I was thinking that the best test would be to listen directly on the stream and catch that message. But the black-box version works great. Update on the way....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants