diff --git a/CHANGELOG.md b/CHANGELOG.md index 611aa71a93d74..93dc007bd54c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 2.2.2-dev + ## 2.2.1 * Fix `Peer` requests not terminating when the underlying channel is closed. diff --git a/pubspec.yaml b/pubspec.yaml index 08c435a7b4fec..806383b6c9031 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: json_rpc_2 -version: 2.2.1 +version: 2.2.2-dev description: >- Utilities to write a client or server using the JSON-RPC 2.0 spec. homepage: https://github.com/dart-lang/json_rpc_2 diff --git a/test/peer_test.dart b/test/peer_test.dart index a9c295a0fefc9..e2c46f8a37686 100644 --- a/test/peer_test.dart +++ b/test/peer_test.dart @@ -102,6 +102,17 @@ void main() { }); }); + test('can be closed', () async { + var incomingController = StreamController(); + var channel = StreamChannel.withGuarantees( + incomingController.stream, + StreamController(), + ); + var peer = json_rpc.Peer.withoutJson(channel); + unawaited(peer.listen()); + await peer.close(); + }, skip: 'https://github.com/dart-lang/json_rpc_2/issues/55'); + group('like a server,', () { test('can receive a call and return a response', () { expect(outgoing.first,