sse_client_dart 3.0.0
sse_client_dart: ^3.0.0 copied to clipboard
A Dart-IO based client implementation of Server-Sent Events.
3.0.0 #
- Added an idempotent, awaitable
EventSource.close()lifecycle API. - Made final-listener cancellation await HTTP and decoder cleanup when
closeOnLastListeneris enabled. - Added cancellable retry timers, connection generations, in-flight request abortion, and race-safe late-response handling.
- Added explicit HTTP client ownership: internally created clients are closed; injected shared clients are never closed.
- Upgraded the minimum
httpdependency to 1.6.0 and useAbortableRequestfor request-scoped cancellation. - Rewrote the SSE decoder to propagate done, error, pause, resume, and cancel; malformed UTF-8 is decoded with replacement characters.
- Corrected SSE parsing for default
messageevents, comments, data-less blocks, retry validation, persistent/empty IDs, and incomplete EOF events. - Reconnect on normal EOF and recoverable transport failures; HTTP 204, non-200 responses, and invalid content types stop the connection.
- Added
autoReconnect, defaulting totrue, so POST and other side-effecting requests can disable all automatic resubmission after EOF or transport failure. - Fixed the final-listener stop race so listeners attached during asynchronous
cleanup start exactly one new connection; permanent
close()still wins. - Preserve original HTTP status codes in
EventSourceSubscriptionException. - Added functional
onOpenand connection-levelonErrorstreams. - Fixed
EventCachebinary search, replay boundaries, missing IDs, channels, and zero/negative capacities. - Fixed encoding of empty data and empty IDs, normalized data line endings, and
validate single-line
idandeventfields. - Removed unused direct
collectionandloggingdependencies. - Raised the declared Dart SDK minimum to 3.4.0, matching
package:http. - Added protocol, retry, ownership, race, paused-listener, and real TCP socket regression tests.
Breaking changes #
- Default SSE events now have
event == "message"instead ofnull. - Comment-only and data-less blocks no longer emit empty events.
- Normal EOF now reconnects instead of remaining closed.
- Connection-level errors are emitted only by
source.onError;source.listen(..., onError: ...)no longer receives them. A server-sentevent: errorremains an ordinary event on the main stream. - Responses without
text/event-streamare rejected. EventCache.replay()emits events after the supplied ID and emits nothing when a non-empty ID is missing.ProxySinkcallbacks are typed and required.EventSourceSubscriptionExceptionfields are immutable.
2.0.0 #
- Continued maintenance of the FeatureHub SSE client implementation.
- Updated dependencies and Dart compatibility.
1.3.3 #
- Updated
httpfrom 0.13.x to 1.x.
1.3.2 #
- Removed leaked print statements.
1.3.1 #
- Fixed connection closing and ready-state notifications.
1.3.0 #
- Updated repository metadata and formatting.
1.2.0 #
- Added null safety.
1.0.0 #
- Initial fork and release.