Skip to content

Commit 3c9d088

Browse files
Releasing version 4.0.0
1 parent 9bfdd13 commit 3c9d088

File tree

8 files changed

+429
-394
lines changed

8 files changed

+429
-394
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22

33
All notable changes to the LaunchDarkly's EventSource implementation for C# will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [4.0.0] - 2021-02-22
6+
Starting with this version, the API documentation for the latest release is viewable at https://launchdarkly.github.io/dotnet-eventsource.
7+
8+
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.
9+
10+
### Added:
11+
- `EventSource.Restart`: this method allows the caller to trigger a connection restart even if there was not an error on the stream.
12+
- `MessageEvent.Name`: previously, the event name was only available as a property of `MessageReceivedEventArgs`.
13+
- `ConfigurationBuilder.DefaultEncoding`: sets the character encoding to use for parsing the stream data if the server did not specify an encoding in its `Content-Type`.
14+
- `ConfigurationBuilder.PreferDataAsUtf8Bytes`: an optional mode in which `EventSource` will read the `data:` property of events as a raw UTF-8 byte array (assuming the stream encoding is UTF-8) to avoid unnecessarily allocating a UTF-16 `string`. This is meant as an optimization for applications that will be processing the data with a UTF-8-based API such as `System.Text.Json`.
15+
- Simple `EventSource(Uri)` constructor for cases where you do not need any other configuration options.
16+
- Standard .NET XML documentation of all public types and methods is now produced in the build.
17+
- The release now publishes a [Source Link](https://github.com/dotnet/sourcelink/blob/master/README.md) package.
18+
19+
### Changed:
20+
- The minimum .NET Standard compatibility version is now 2.0.
21+
- The minimum .NET Framework compatibility version is now 4.5.2.
22+
- Logging now works through the new [`LaunchDarkly.Logging`](https://github.com/launchdarkly/dotnet-logging) facade which is used by LaunchDarkly .NET-based SDKs, instead of `Common.Logging`.
23+
- `ConfigurationBuilder` methods no longer throw any exceptions, except for one case: passing `null` for 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-null `HttpClient` and a non-null `HttpMessageHandler`), one will simply override the other as described in the API documentation.
24+
- `ConfigurationBuilder.DelayRetryDuration` is named to `InitialRetryDelay`, which more accurately describes its meaning.
25+
- `ConfigurationBuilder.MessageHandler` is renamed to `HttpMessageHandler`, since that's the name of its type (also, "message" has other meanings in this API).
26+
- The type of `Configuration.HttpContentFactory` is now simply `Func<HttpContent>` rather than using a custom delegate type.
27+
- If you pass a `Dictionary` of headers to `ConfigurationBuilder.RequestHeaders`, it will now be copied. Previously the configuration retained a reference to the original `Dictionary`, which could cause problems if it was later modified.
28+
- `EventSource` now implements the stream read timeout in a way that uses the task scheduler more efficiently. Previously, it executed an additional task for each read with `Task.Delay`; now, it uses a timed cancellation token.
29+
- Exception messages have been rewritten for clarity and style.
30+
31+
### Fixed:
32+
- `ConfigurationBuilder.BackoffResetThreshold` had no effect; the default value was being used regardless of what you set it to.
33+
- When reading the SSE stream, `EventSource` was using a case-insensitive comparison to recognize field names like `event` and `data`. The [SSE specification](https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation) states that field name "must be compared literally, with no case folding performed," so a field name like `EVENT` is invalid.
34+
35+
### Removed:
36+
- Removed all types and methods that were marked as deprecated/obsolete in the last 3.x version.
37+
- `Configuration` no longer has a public constructor. Instances must now be created with `Configuration.Builder`.
38+
- The helper class `ExponentialBackoffWithDecorrelation` is no longer public.
39+
540
## [3.4.0] - 2020-12-03
641
### Added:
742
- You can now tell EventSource to use an `HttpClient` instance that you provide by calling `ConfigurationBuilder.HttpClient`. (Thanks, [thorstenfleischmann](https://github.com/launchdarkly/dotnet-eventsource/pull/61)!)

LaunchDarkly.EventSource.sln

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.16
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaunchDarkly.EventSource.Tests", "test\LaunchDarkly.EventSource.Tests\LaunchDarkly.EventSource.Tests.csproj", "{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}"
7-
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaunchDarkly.EventSource", "src\LaunchDarkly.EventSource\LaunchDarkly.EventSource.csproj", "{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}"
9-
EndProject
10-
Global
11-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|Any CPU = Debug|Any CPU
13-
Release|Any CPU = Release|Any CPU
14-
EndGlobalSection
15-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16-
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17-
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
19-
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Release|Any CPU.Build.0 = Release|Any CPU
20-
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21-
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22-
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Release|Any CPU.Build.0 = Release|Any CPU
24-
EndGlobalSection
25-
GlobalSection(SolutionProperties) = preSolution
26-
HideSolutionNode = FALSE
27-
EndGlobalSection
28-
GlobalSection(ExtensibilityGlobals) = postSolution
29-
SolutionGuid = {9F16BE9A-475D-4B82-856B-876A3262B7C4}
30-
EndGlobalSection
31-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaunchDarkly.EventSource.Tests", "test\LaunchDarkly.EventSource.Tests\LaunchDarkly.EventSource.Tests.csproj", "{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaunchDarkly.EventSource", "src\LaunchDarkly.EventSource\LaunchDarkly.EventSource.csproj", "{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{5F6107FB-8BEF-4636-9FC3-70EB3C9095FA}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{4A78D1AF-516D-4A83-A172-EBA2856DDA2B}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {9F16BE9A-475D-4B82-856B-876A3262B7C4}
30+
EndGlobalSection
31+
EndGlobal

0 commit comments

Comments
 (0)