-
Notifications
You must be signed in to change notification settings - Fork 76
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 yamux remote open #292
Conversation
Also fixes #291 |
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.
Would be also really nice if you could add a unit test on any regression found and fixed 👍
onStreamCreate(msg.id) // sometimes writes can happen before onRemoteCreated is called | ||
onRemoteOpen(msg.id) |
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.
That would result to onStreamCreate()
is called twice.
What's the intention of calling onStreamCreate()
explicitly here?
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.
The send window needs to be initialized before onRemoteOpen, otherwise it errors and fails to do the first write.
I was hoping you could help with the unit test, as my Kotlin is not up to scratch (You probably guessed but this is the first Kotlin I've written). |
@ianopolous please check Peergos#10 |
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.
LGTM when merged Peergos#10
Add unit test
Bitswap and identify from kubo, on a connection we initiated, was failing because we were not writing the /multistream/1.0.0 because the send window had not been initialised yet for a remote opened stream in yamux.
We should also tolerate window updates which close a stream and have 0 size (rather than error).
Would also make an excellent candidate unit test.
A connects to B
B opens stream to A
A immediately writes /multistream/1.0.0\n (This must happen during onRemoteOpen)
B does a single write of /multistream/1.0.0\n/ipfs/id/1.0.0\n
A writes /ipfs/id/1.0.0\n
B must receive both writes for success