Proper close on error (dart-lang/sse#21)
diff --git a/pkgs/sse/CHANGELOG.md b/pkgs/sse/CHANGELOG.md index d584733..b5fb859 100644 --- a/pkgs/sse/CHANGELOG.md +++ b/pkgs/sse/CHANGELOG.md
@@ -1,3 +1,8 @@ +## 3.1.2 + +- Fix an issue where the `SseClient` would not send a `done` event when there + was an error with the SSE connection. + ## 3.1.1 - Make `isInKeepAlive` on `SseConnection` private.
diff --git a/pkgs/sse/lib/client/sse_client.dart b/pkgs/sse/lib/client/sse_client.dart index 764e566..232a9c9 100644 --- a/pkgs/sse/lib/client/sse_client.dart +++ b/pkgs/sse/lib/client/sse_client.dart
@@ -47,7 +47,7 @@ // Allow for a retry to connect before giving up. _errorTimer = Timer(const Duration(seconds: 5), () { _incomingController.addError(error); - _eventSource.close(); + close(); }); } });
diff --git a/pkgs/sse/pubspec.yaml b/pkgs/sse/pubspec.yaml index b2067ac..86d3c13 100644 --- a/pkgs/sse/pubspec.yaml +++ b/pkgs/sse/pubspec.yaml
@@ -1,5 +1,5 @@ name: sse -version: 3.1.2-dev +version: 3.1.2 homepage: https://github.com/dart-lang/sse description: >- Provides client and server functionality for setting up bi-directional