Skip to content
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

Ignore error if can't write back multistream protocol id #89

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

MarcoPolo
Copy link
Contributor

A continuation of #87. It's the same thing, but we didn't account for the case the the stream is closed so early we don't get a chance to write our multistream select protocol id.

Worth noting that the old NegotiateLazy also ignored this error, so it should be a safe change (since this is the same as the old behavior).

@@ -665,7 +665,7 @@ func (rob *readonlyBuffer) Close() error {
return nil
}

func TestNegotiateFail(t *testing.T) {
func TestNegotiatThenWriteFail(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marten-seemann highlighting this change. I'm changing this test so that it passes with the current behavior (negotiate works even if you can't write to it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change goes makes this behavor more like negotiatelazy (wrt write errors). See the previous change here: https://github.com/multiformats/go-multistream/pull/85/files#diff-e59d8a202c91e1303878fa9a18fea9f6a2e3258b609bf4cc1874a17314cb26f8L679

@MarcoPolo MarcoPolo merged commit 7d0eb23 into master Jun 27, 2022
@MarcoPolo MarcoPolo deleted the marco/fix-write-and-close-2 branch June 27, 2022 15:09
@MarcoPolo MarcoPolo mentioned this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants