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

fix: close streams when connection is closed #214

Merged
merged 5 commits into from
May 20, 2022

Conversation

achingbrain
Copy link
Member

This adds tests for closeRead and closeWrite on the muxer streams.

Also:

  • Removed libp2p-tcp in favor of it-pair to avoid circular deps
  • Connection.close() will now close its internal streams to avoid lingering streams.

Supersedes #90

BREAKING CHANGE: This adds closeWrite and closeRead checks in the tests, which will cause test failures for muxers that don't implement those

This adds tests for closeRead and closeWrite on the muxer streams.

Also:

- Removed libp2p-tcp in favor of it-pair to avoid circular deps
- Connection.close() will now close its internal streams to avoid lingering streams.

Supersedes #90

BREAKING CHANGE: This adds closeWrite and closeRead checks in the tests, which will cause test failures for muxers that don't implement those
If you are `.abort()`ing a stream, pass an error, otherwise call `.close()`
achingbrain added a commit to libp2p/js-libp2p that referenced this pull request May 19, 2022
@achingbrain achingbrain merged commit 88fcd58 into master May 20, 2022
@achingbrain achingbrain deleted the fix/close-streams-when-connection-is-closed branch May 20, 2022 17:12
github-actions bot pushed a commit that referenced this pull request May 20, 2022
## [@libp2p/interfaces-v2.0.0](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/interfaces-v1.3.32...@libp2p/interfaces-v2.0.0) (2022-05-20)

### ⚠ BREAKING CHANGES

* This adds closeWrite and closeRead checks in the tests, which will cause test failures for muxers that don't implement those

### Bug Fixes

* close streams when connection is closed ([#214](#214)) ([88fcd58](88fcd58)), closes [#90](#90)
@github-actions
Copy link

🎉 This PR is included in version @libp2p/interfaces-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request May 20, 2022
## [@libp2p/interface-compliance-tests-v2.0.0](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/interface-compliance-tests-v1.1.34...@libp2p/interface-compliance-tests-v2.0.0) (2022-05-20)

### ⚠ BREAKING CHANGES

* This adds closeWrite and closeRead checks in the tests, which will cause test failures for muxers that don't implement those

### Bug Fixes

* close streams when connection is closed ([#214](#214)) ([88fcd58](88fcd58)), closes [#90](#90)
* update interfaces ([#215](#215)) ([72e6890](72e6890))
@github-actions
Copy link

🎉 This PR is included in version @libp2p/interface-compliance-tests-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request May 20, 2022
## [@libp2p/connection-v2.0.0](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/connection-v1.1.5...@libp2p/connection-v2.0.0) (2022-05-20)

### ⚠ BREAKING CHANGES

* This adds closeWrite and closeRead checks in the tests, which will cause test failures for muxers that don't implement those

### Bug Fixes

* close streams when connection is closed ([#214](#214)) ([88fcd58](88fcd58)), closes [#90](#90)
* update interfaces ([#215](#215)) ([72e6890](72e6890))
@github-actions
Copy link

🎉 This PR is included in version @libp2p/connection-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

1 participant