Releases: launchdarkly/dotnet-eventsource
Releases · launchdarkly/dotnet-eventsource
4.0.0
[4.0.0] - 2021-02-22
Starting with this version, the API documentation for the latest release is viewable at https://launchdarkly.github.io/dotnet-eventsource.
The 4.x major version of LaunchDarkly.EventSource will be used in the upcoming major version releases of LaunchDarkly's .NET-based SDKs. This release streamlines the API, updates platform compatibility, and improves performance.
Added:
EventSource.Restart: this method allows the caller to trigger a connection restart even if there was not an error on the stream.MessageEvent.Name: previously, the event name was only available as a property ofMessageReceivedEventArgs.ConfigurationBuilder.DefaultEncoding: sets the character encoding to use for parsing the stream data if the server did not specify an encoding in itsContent-Type.ConfigurationBuilder.PreferDataAsUtf8Bytes: an optional mode in whichEventSourcewill read thedata:property of events as a raw UTF-8 byte array (assuming the stream encoding is UTF-8) to avoid unnecessarily allocating a UTF-16string. This is meant as an optimization for applications that will be processing the data with a UTF-8-based API such asSystem.Text.Json.- Simple
EventSource(Uri)constructor for cases where you do not need any other configuration options. - Standard .NET XML documentation of all public types and methods is now produced in the build.
- The release now publishes a Source Link package.
Changed:
- The minimum .NET Standard compatibility version is now 2.0.
- The minimum .NET Framework compatibility version is now 4.5.2.
- Logging now works through the new
LaunchDarkly.Loggingfacade which is used by LaunchDarkly .NET-based SDKs, instead ofCommon.Logging. ConfigurationBuildermethods no longer throw any exceptions, except for one case: passingnullfor the stream URI. In all cases where a property has a maximum and/or minimum value, if you try to set a value outside that range it will simply be changed to the closest valid value. If two properties do not make sense to use together (such as a non-nullHttpClientand a non-nullHttpMessageHandler), one will simply override the other as described in the API documentation.ConfigurationBuilder.DelayRetryDurationis named toInitialRetryDelay, which more accurately describes its meaning.ConfigurationBuilder.MessageHandleris renamed toHttpMessageHandler, since that's the name of its type (also, "message" has other meanings in this API).- The type of
Configuration.HttpContentFactoryis now simplyFunc<HttpContent>rather than using a custom delegate type. - If you pass a
Dictionaryof headers toConfigurationBuilder.RequestHeaders, it will now be copied. Previously the configuration retained a reference to the originalDictionary, which could cause problems if it was later modified. EventSourcenow implements the stream read timeout in a way that uses the task scheduler more efficiently. Previously, it executed an additional task for each read withTask.Delay; now, it uses a timed cancellation token.- Exception messages have been rewritten for clarity and style.
Fixed:
ConfigurationBuilder.BackoffResetThresholdhad no effect; the default value was being used regardless of what you set it to.- When reading the SSE stream,
EventSourcewas using a case-insensitive comparison to recognize field names likeeventanddata. The SSE specification states that field name "must be compared literally, with no case folding performed," so a field name likeEVENTis invalid.
Removed:
- Removed all types and methods that were marked as deprecated/obsolete in the last 3.x version.
Configurationno longer has a public constructor. Instances must now be created withConfiguration.Builder.- The helper class
ExponentialBackoffWithDecorrelationis no longer public.
3.4.0
[3.4.0] - 2020-12-03
Added:
- You can now tell EventSource to use an
HttpClientinstance that you provide by callingConfigurationBuilder.HttpClient. (Thanks, thorstenfleischmann!)
3.3.3
[3.3.3] - 2020-11-05
Added:
- The package now has a specific target for .NET Standard 2.0, in addition to the previous targets of .NET Standard 1.4 and .NET Framework 4.5. There is no functional difference between the 2.0 and 1.4 builds, but it may be desirable for .NET Core/.NET Standard code to be able to avoid linking to any .NET Standard 1.x assemblies.
3.3.2
3.3.1
[3.3.1] - 2019-08-08
Fixed:
- If you don't explicitly provide an
HttpMessageHandlerin the configuration, EventSource will now use the defaultHttpClientconstructor; previously, it would create an instance of the standard .NETHttpMessageHandlerimplementation and tell theHttpClientto use that. In .NET Framework and .NET Standard, this makes no difference, but in Xamarin, calling the defaultHttpClientconstructor may allow it to use a better HTTP implementation based on native APIs. - Expanded and improved documentation comments.
3.3.0
[3.3.0] - 2019-03-26
Added:
- The
EventSourcenow implementsIDisposable. CallingDispose()has the same effect as callingClose().
3.2.3
[3.2.3] - 2019-01-14
Fixed:
- The assemblies in this package now have Authenticode signatures. The release note for 3.2.1 was an error; that release did not include signatures.
3.2.2
[3.2.2] - 2019-01-09
Removed
- The console applications for manual testing have been removed (because the unit tests now include full end-to-end tests against a stub HTTP server).
3.2.1
[3.2.1] - 2019-01-07
Changed
- The published assemblies are now digitally signed as well as strong-named. Also, they are now built in Release mode and do not contain debug information.
3.2.0
[3.2.0] - 2018-10-24
Added
- Previously, the delay before reconnect attempts would increase exponentially only if the previous connection could not be made at all or returned an HTTP error; if it received an HTTP 200 status, the delay would be reset to the minimum even if the connection then immediately failed. Now, the new configuration property
BackoffResetThreshold(default: 1 minute) specifies the length of time that a connection must stay active in order for the reconnect delay to be reset. (#37)
Fixed
-
Fixed an unobserved exception that could occur following a stream timeout, which could cause a crash in .NET 4.0.
-
A
NullReferenceExceptioncould sometimes be logged if a stream connection failed. (#24)