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

fix: prevent double dialing same peer #63

Merged
merged 5 commits into from
Dec 6, 2018

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Nov 28, 2018

Fixes #62

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation using a Set looks good to me!

However, I feel that we should not add the events for dialing, unless we have a concrete use case from users of this module.

src/base.js Outdated Show resolved Hide resolved
test/2-nodes.js Outdated Show resolved Hide resolved
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left just a new note! It looks like we decreased some coverage, as well.

Can you add a test for the following scenario:

// stopped, so we should just bail out
if (!this._dials.has(idB58Str)) {
 return callback()
}

@dirkmc
Copy link
Contributor Author

dirkmc commented Nov 30, 2018

@vasco-santos it seems like maybe we're missing an error handler somewhere in the transport stack:
https://ci.ipfs.team/blue/organizations/jenkins/libp2p%2Fjs-libp2p-floodsub/detail/PR-63/5/pipeline/256
Do you have any ideas on how to fix?

@vasco-santos
Copy link
Member

So, it seems it is failing on spdy-transport. @jacobheun can you have a look?

@jacobheun
Copy link
Contributor

@vasco-santos I'll take a look, floodsub is using some pretty old deps. I'll get a PR together with any necessary changes. The error itself isn't a problem, but obviously we don't want bubbling unhandled exceptions.

@vasco-santos
Copy link
Member

thanks @jacobheun

@vasco-santos
Copy link
Member

@jacobheun already fixed the spdy issue ❤️

@dirkmc can you rebase the PR now?

@vasco-santos
Copy link
Member

Thanks @dirkmc

There are a few lines added that are not covered by the tests, for instance, https://codecov.io/gh/libp2p/js-libp2p-floodsub/src/8f1e36f8ad0488cf50efaa8aba981c8153cf54f9/src/base.js#L112

Can you have a look?

@dirkmc
Copy link
Contributor Author

dirkmc commented Dec 5, 2018

Oh hmm that definitely should be covered, I'll take a look

Also thanks @jacobheun for upgrading everything 👍

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @dirkmc !
LGTM

@vasco-santos vasco-santos merged commit 3303ad0 into libp2p:master Dec 6, 2018
@dirkmc
Copy link
Contributor Author

dirkmc commented Dec 6, 2018

I have to say I'm impressed with the tooling you guys have put in place, it caught some very subtle cases where after Jacob's upgrade some of the test cases I had written were no longer testing what they appeared, even though they were still passing. Kudos 👍

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.

3 participants