-
Notifications
You must be signed in to change notification settings - Fork 445
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
fix: upgrader should not need muxers #517
fix: upgrader should not need muxers #517
Conversation
]) | ||
|
||
expect(connections).to.have.length(2) | ||
}) |
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.
Should I test the errors with multiplexer operations in the connection
?
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.
It might be good to add a quick test. They should also throw errors with codes.
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.
I think it would be good to also add a test for closing. It's going to the MultiaddrConn so it should be fine, but I think having it for avoid regressions in the future would be good.
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.
I added to this test. I think it is better than create a new test
45c2760
to
8d7c110
Compare
]) | ||
|
||
expect(connections).to.have.length(2) | ||
}) |
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.
It might be good to add a quick test. They should also throw errors with codes.
1e7dc25
to
7eb4309
Compare
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.
Just some minor things, otherwise this looks good!
@@ -244,20 +292,9 @@ class Upgrader { | |||
} | |||
|
|||
// Pipe all data through the muxer | |||
pipe(muxedConnection, muxer, muxedConnection) | |||
pipe(upgradedConn, muxer, upgradedConn) | |||
|
|||
maConn.timeline.upgraded = Date.now() |
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.
We should just set this right after we created the timeline Proxy, that way we don't need to set it here and in the !Muxer
if statement above.
]) | ||
|
||
expect(connections).to.have.length(2) | ||
}) |
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.
I think it would be good to also add a test for closing. It's going to the MultiaddrConn so it should be fine, but I think having it for avoid regressions in the future would be good.
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
031d6aa
to
def7e54
Compare
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.
🎉
* fix: upgrader should not need muxers * chore: address review * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
With the current codebase, having a
streamMuxer
is mandatory, which was not the case before. This PR allows a connection to be upgraded just with crypto.Note: the
connection
properties regarding multiplexers are throwing an error now.