Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit f14b268

Browse files
authored
prepare 5.7.1 release (#106)
1 parent 4ab5903 commit f14b268

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
All notable changes to the LaunchDarkly .NET Server-Side SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5-
## [5.7.0] - 2019-09-12
5+
## [5.7.1] - 2019-09-12
6+
_(The changes below were originally released in 5.7.0, but that release was broken; 5.7.1 is its replacement.)_
7+
68
This release includes new types and deprecations that correspond to upcoming changes in version 6.0.0. Developers are encouraged to start adopting these changes in their code now so that migrating to 6.0.0 in the future will be easier. Most of these changes are related to the use of mutable types, which are undesirable in a concurrent environment. `User` and `Configuration` are currently mutable types; they will be made immutable in the future, so there are now builders for them. Arbitrary JSON values are currently represented with the `Newtonsoft.Json` type `JToken`, which is mutable (if it contains an array or a JSON object); the new type `LdValue` is safer, and will eventually completely replace `JToken` in the public API.
79

810
Also, generated HTML documentation for all of the SDK's public types, properties, and methods is now available online at https://launchdarkly.github.io/dotnet-server-sdk/. Currently this will only show the latest released version.

src/LaunchDarkly.ServerSdk/LaunchDarkly.ServerSdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>5.7.0</Version>
3+
<Version>5.7.1</Version>
44
<TargetFrameworks>netstandard1.4;netstandard1.6;netstandard2.0;net45</TargetFrameworks>
55
<PackageLicenseUrl>https://raw.githubusercontent.com/launchdarkly/dotnet-server-sdk/master/LICENSE</PackageLicenseUrl>
66
<DebugType>portable</DebugType>

src/LaunchDarkly.ServerSdk/LdClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private EvaluationDetail<T> Evaluate<T>(string featureKey, User user, LdValue de
345345
}
346346
else
347347
{
348-
if (checkType && evalDetail.Value.Type != defaultValue.Type)
348+
if (checkType && !defaultValue.IsNull && evalDetail.Value.Type != defaultValue.Type)
349349
{
350350
Log.ErrorFormat("Expected type: {0} but got {1} when evaluating FeatureFlag: {2}. Returning default",
351351
defaultValue.Type,

test/LaunchDarkly.ServerSdk.Tests/LdClientEvaluationTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,27 @@ public void StringVariationReturnsFlagValue()
171171
Assert.Equal("b", client.StringVariation("key", user, "a"));
172172
}
173173

174+
[Fact]
175+
public void StringVariationWithNullDefaultReturnsFlagValue()
176+
{
177+
featureStore.Upsert(VersionedDataKind.Features,
178+
new FeatureFlagBuilder("key").OffWithValue(new JValue("b")).Build());
179+
180+
Assert.Equal("b", client.StringVariation("key", user, null));
181+
}
182+
174183
[Fact]
175184
public void StringVariationReturnsDefaultValueForUnknownFlag()
176185
{
177186
Assert.Equal("a", client.StringVariation("key", user, "a"));
178187
}
179188

189+
[Fact]
190+
public void StringVariationWithNullDefaultReturnsDefaultValueForUnknownFlag()
191+
{
192+
Assert.Null(client.StringVariation("key", user, null));
193+
}
194+
180195
[Fact]
181196
public void StringVariationReturnsDefaultValueForWrongType()
182197
{

0 commit comments

Comments
 (0)