All notable changes to the project will be documented in this file. This project adheres to Semantic Versioning.
1.11.2 (2026-07-29)
- Flush once per replayed batch instead of once per event (#64) (e505af0)
- unblock Repository producers when a subscriber disconnects mid-replay (#63) (1146284)
1.11.1 (2026-07-22)
- prevent stream shutdown deadlock when Close races with event delivery (1067581)
- prevent stream shutdown deadlock when Close races with event delivery (#60) (c3ddae0)
1.11.0 (2025-11-20)
1.10.0 (2025-07-01)
1.9.1 (2025-06-02)
1.9.0 (2025-04-21)
1.8.0 (2024-12-19)
- In the SSE server implementation, removed string concatenation logic that caused writing of large messages to be unnecessarily memory-intensive. (Thanks, moshegood!)
- The SSE server implementation did not correctly write a message if the data field was empty: it dropped the field entirely, which would cause clients not to read the message.
This release includes improvements for SSE spec compliance that do not affect usage in the LaunchDarkly Go SDK, but may be relevant in other use cases.
- Each event returned by the client now includes the last event ID that was seen on this stream (if any), rather than only the ID (if any) that was in that particular event. This is a requirement of the SSE spec. For backward compatibility,
Event.Id()still has the old behavior of returning only the ID for that event; the new behavior is in a new interface method,EventWithLastID.LastEventID(). Every event returned by the client implements bothEventandEventWithLastID.
- CI tests now use the latest
v2release of https://github.com/launchdarkly/sse-contract-tests.
- The client should discard any
id:field that contains a null character, as per the SSE spec.
- Removed extra newline from "Reconnecting in..." log message.
Server.Handler()now uses the standardcontext.Contextmechanism to detect when a request has been cancelled, instead of the deprecatedhttp.CloseNotifier.
Server.Unregistermethod for removing aRepositoryregistration and optionally forcing clients to disconnect.Server.PublishWithAcknowledgementmethod for ensuring that an action does not happen until an event has been dispatched.
- Fixed a race condition in which
Servermight close a channel while another goroutine is trying to write to it. This would happen if you registered aRepositorythat replays events, started a handler, then closed theServerwhile the events were still replaying. - Improved unit test coverage.
Server.MaxConnTimeis an optional setting to make theServerautomatically close any stream connection that has stayed open for at least that amount of time. This may be useful in preventing server instances from accumulating too many connections in a load-balanced environment.
- The only changes in this release are to the test dependencies, to avoid bringing in unnecessary transitive dependencies such as
go-sdk-common. Some of the test dependencies are now modules that can only be used in Go 1.13+, which means that the test build for this project only runs in Go 1.13+, but it can still be imported by projects that use older Go versions.
- Added
go.modso this package can be consumed as a module. This does not affect code that is currently consuming it viago get,dep, orgovendor.
- An error in the backoff logic added in v1.4.0 could cause a panic after many successive retries, due to the exponential backoff value exceeding
math.MaxInt64resulting in a negative number being passed torandom.Int63n.
- New option
StreamOptionErrorHandlerprovides an alternate way to receive errors and control howStreambehaves after an error. - New
StreammethodRestart()provides a way to make the stream reconnect at any time even if it has not detected an error, using the same retry semantics (backoff, jitter, etc.) that have already been configured.
- New option
StreamOptionUseBackoffallowsStreamto be configured to use exponential backoff for reconnections. There was existing logic for exponential backoff, but it was not working, so until now the retry delay was always the same; for backward compatibility with that behavior, the default is still to not use backoff. - The new option
StreamOptionRetryResetIntervalcan be used in conjunction withStreamOptionUseBackoffto determine when, if ever, the retry delay can be reset to its initial value rather than continuing to decrease. - New option
StreamOptionUseJittertellsStreamto subtract a pseudo-random amount from the retry delay. - New option
StreamOptionCanRetryFirstConnectiontellsStreamthat it can retry the initial connection attempt. Previously, a failed initial connection would be considered a permanent failure.
NewDecoderWithOptionsallows creating aDecoderwith non-default settings; currently the only such setting isDecoderOptionReadTimeout. Normally you will not need to create aDecoderdirectly; it is done automatically byStream.
- Reverted an unintentional change in v1.1.0 to the signature of the exported function
NewDecoder.
- It is now possible to specify a read timeout for a stream. If the stream does not receive new data (either events or comments) within this interval, it will emit an error and restart the connection.
- New stream constructor methods
SubscribeWithURLandSubscribeWithRequestAndOptionsallow any combination of optional configuration parameters to be specified for a stream: read timeout, initial retry delay, last event ID, HTTP client, logger.
- Avoid trying to to decode non-200 responses which was generating extra error messages.
Initial release of this fork.
- Added support for Close() method.