sse_client_dart 3.0.0 copy "sse_client_dart: ^3.0.0" to clipboard
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 closeOnLastListener is 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 http dependency to 1.6.0 and use AbortableRequest for 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 message events, 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 to true, 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 onOpen and connection-level onError streams.
  • Fixed EventCache binary 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 id and event fields.
  • Removed unused direct collection and logging dependencies.
  • 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 of null.
  • 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-sent event: error remains an ordinary event on the main stream.
  • Responses without text/event-stream are rejected.
  • EventCache.replay() emits events after the supplied ID and emits nothing when a non-empty ID is missing.
  • ProxySink callbacks are typed and required.
  • EventSourceSubscriptionException fields are immutable.

2.0.0 #

  • Continued maintenance of the FeatureHub SSE client implementation.
  • Updated dependencies and Dart compatibility.

1.3.3 #

  • Updated http from 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.
0
likes
150
points
36
downloads

Documentation

API reference

Publisher

verified publisherdjbird.top

Weekly Downloads

A Dart-IO based client implementation of Server-Sent Events.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on sse_client_dart