All notable changes to LaunchDarkly.CommonSdk
will be documented in this file. For full release notes for the projects that depend on this project, see their respective changelogs. This file describes changes only to the common code. This project adheres to Semantic Versioning.
- IEnvironmentReporter now reports nullable values.
- Adds locale to auto environment attribute layer.
- Adds ApplicationInfo and EnvironmentReporter and respective builders.
- Fixed an issue with generating the
FullyQualifiedKey
. The key generation was not sorted by the kind, so the key was not stable depending on the order of the context construction. This also affected the generation of the secure mode hash for mulit-contexts.
This major version release of LaunchDarkly.CommonSdk
corresponds to the upcoming v7.0.0 release of the LaunchDarkly server-side .NET SDK (LaunchDarkly.ServerSdk
) and the v3.0.0 release of the LaunchDarkly client-side .NET SDK (LaunchDarkly.ClientSdk
), and cannot be used with earlier SDK versions.
- In
LaunchDarkly.Sdk
, the typesContext
andContextKind
define the new "context" model. "Contexts" are a replacement for the earlier concept of "users"; they can be populated with attributes in more or less the same way as before, but they also support new behaviors. More information about these features will be included in the release notes for theLaunchDarkly.ServerSdk
7.0.0 andLaunchDarkly.ClientSdk
3.0.0 releases.
- .NET Core 2.1, .NET Framework 4.5.2, .NET Framework 4.6.1, and .NET 5.0 are now unsupported. The minimum platform versions are now .NET Core 3.1, .NET Framework 4.6.2, .NET 6.0, and .NET Standard 2.0.
- It was previously allowable to set a user key to an empty string. In the new context model, the key is not allowed to be empty. Trying to use an empty key will cause evaluations to fail and return the default value.
- There is no longer such a thing as a
Secondary
meta-attribute that affects percentage rollouts. If you set an attribute with that name in aContext
, it will simply be a custom attribute like any other. - The
Anonymous
attribute inLDUser
is now a simple boolean, with no distinction between a false state and a null state. - There is no longer a dependency on
LaunchDarkly.JsonStream
. This package existed because some platforms did not support theSystem.Text.Json
API, but that is no longer the case and the SDK now usesSystem.Text.Json
directly for all of its JSON operations. - If you are using the package
LaunchDarkly.CommonSdk.JsonNet
for interoperability with the Json.NET library, you must update this to the latest major version.
- Removed all types, fields, and methods that were deprecated as of the most recent release.
- Removed the
Secondary
meta-attribute inUser
andUserBuilder
.
UnixMillisecondTime
now has a JSON converter like otherLaunchDarkly.Sdk
types.
- When using
LaunchDarkly.CommonSdk.JsonNet
, nullable value types such asEvaluationReason?
were not being serialized correctly.
- Copying a user with
User.Builder(existingUser)
was incorrectly changing the defaultnull
value ofAnonymousOptional
tofalse
. This normally has no significance since LaunchDarkly treats those two values the same, but it could have broken tests that expected a copied user to be equal.
LdValue.ObjectBuilder.Remove
.- User builder
Custom
overloads forlong
anddouble
.
- Added more doc comment text about numeric precision issues with JSON numbers.
- Updated
LaunchDarkly.JsonStream
to 1.0.3.
- Convenience methods for working with JSON object and array values:
LdValue.Dictionary
,LdValue.List
,LdValue.ObjectBuilder.Set
, andLdValue.ObjectBuilder.Copy
.
- Changed dependency version for
System.Collections.Immutable
to 1.7.1, to match the version used byLaunchDarkly.ServerSdk
. This has no effect on SDK functionality, but it reduces the chance that a binding redirect will be required to reconcile dependency versions in .NET Framework.
- In
EvaluationReason
, added optional status information related to the new big segments feature.
- The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
- Updated the minimum dependency version for
LaunchDarkly.JsonStream
to exclude versions that have a known JSON parsing bug.
- Updated dependencies in
LaunchDarkly.CommonSdk.JsonNet
to the correct versions.
LaunchDarkly.Sdk.Json
namespace with JSON serialization helpers. Also, there is now a separate package defined in this repo,LaunchDarkly.CommonSdk.JsonNet
, for interoperability withNewtonsoft.Json
.UnixMillisecondTime
type, a convenient wrapper for the date/time format that is used by LaunchDarkly services. Applications normally won't need to use this unless they are interacting directly with the analytics event system.LdValue
now has==
and!=
operators.- Releases now publish Source Link data.
- The base namespace is now
LaunchDarkly.Sdk
rather thanLaunchDarkly.Client
. EvaluationReason
is now a struct.EvaluationReasonKind
andEvaluationErrorKind
enum names now use regular .NET-style capitalization (RuleMatch
) instead of Java-style capitalization (RULE_MATCH
).- JSON-serializable types (
User
, etc.) now automatically encode and decode correctly withSystem.Text.Json
.
EvaluationReason
subclasses.- There is no longer a package dependency on
Newtonsoft.Json
. - Non-public helpers used by SDKs have been removed, and are now in
LaunchDarkly.InternalSdk
instead.
- A bug in the SDK prevented the sending of events from being retried after a failure. The SDK now retries once after an event flush fails as was intended.
- The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
EvaluationReason
static methods and properties for creating reason instances.LdValue
helpers for dealing with array/object values, without having to use an intermediateList
orDictionary
:BuildArray
,BuildObject
,Count
,Get
.LdValue.Parse()
.IUserBuilder.Secondary
is a new name forSecondaryKey
(for consistency with other SDKs), and allows you to make thesecondary
attribute private.User.Secondary
(same asSecondaryKey
).
EvaluationReason
properties all exist on the base class now, so for instance you do not need to cast toRuleMatch
to get theRuleId
property. This is in preparation for a future API change in whichEvaluationReason
will become a struct instead of a base class.
- Improved memory usage and performance when processing analytics events: the SDK now encodes event data to JSON directly, instead of creating intermediate objects and serializing them via reflection.
- When parsing arbitrary JSON values, the SDK now always stores them internally as
LdValue
rather thanJToken
. This means that no additional copying step is required when the application accesses that value, if it is of a complex type. LdValue.Equals()
incorrectly returned true for object (dictionary) values that were not equal.
EvaluationReason
subclasses. Use only the base class properties and methods to ensure compatibility with future versions.IUserBuilder.SecondaryKey
,User.SecondaryKey
.
- The JSON serialization of
User
was producing an extraAnonymous
property in addition toanonymous
. If Newtonsoft.Json was configured globally to force all properties to lowercase, this would cause an exception when serializing a user since the two properties would end up with the same name.
- Added
LaunchDarkly.Logging.ConsoleAdapter
as a convenience for quickly enabling console logging; this is equivalent toCommon.Logging.Simple.ConsoleOutLoggerFactoryAdapter
, but the latter is not available on some platforms.
IUserBuilder.AnonymousOptional
andUser.AnonymousOption
allow treating theAnonymous
property as nullable (necessary for consistency with other SDKs). See note about this under Fixed.
IUserBuilder
was incorrectly setting the user'sAnonymous
property tonull
even if it had been explicitly set tofalse
. Null and false behave the same in terms of LaunchDarkly's user indexing behavior, but currently it is possible to create a feature flag rule that treats them differently. SoIUserBuilder.Anonymous(false)
now correctly sets it tofalse
.LdValue.Convert.Long
was mistakenly converting to anint
rather than along
. (#32)
The 4.0.0 release was broken.
LdValue
now has methods for converting to and from complex types (list, dictionary).
ImmutableJsonValue
is now calledLdValue
.- All public APIs now use
ImmutableJsonValue
instead ofJToken
.
- Public
ImmutableJsonValue
methods and properties that refer toJToken
,JObject
, orJArray
.
SetOffline
method inIEventProcessor
/DefaultEventProcessor
.- XML documentation comments are now included in the package for all target frameworks. Previously they were only included for .NET Standard 1.4.
User.Builder
provides a fluent builder pattern for constructingUser
objects. This is now the only method for building a user if you want to set any properties other than theKey
.- The
ImmutableJsonValue
type provides a wrapper for the Newtonsoft.Json types that prevents accidentally modifying JSON object properties or array values that are shared by other objects. - Helper type
ValueType
/ValueTypes
for use by the SDKVariation
methods. - Internal interfaces for configuring specific components, like
IEventProcessorConfiguration
. These replaceIBaseConfiguration
.
User
objects are now immutable.- In
User
,IpAddress
has been renamed toIPAddress
(standard .NET capitalization for two-letter acronyms). - Custom attributes in
User.Custom
now use the typeImmutableJsonValue
instead ofJToken
. - Uses of mutable
IDictionary
andISet
in the configuration and user objects have been changed to immutable types.
UserExtensions
(useUser.Builder
).User
constructors (useUser.WithKey
orUser.Builder
).User
property setters.IBaseConfiguration
andICommonLdClient
interfaces.
- No longer assumes that we are overriding the
HttpMessageHandler
(if it is null in the configuration, just use the defaultHttpClient
constructor). This is important for Xamarin.
- Updated the
LaunchDarkly.EventSource
dependency to a version that has a specific target for .NET Standard 2.0. Previously, that package targeted only .NET Standard 1.4 and .NET Framework 4.5. There is no functional difference between these targets, but .NET Core application developers may wish to avoid linking to any .NET Standard 1.x assemblies on general principle.
DefaultEventProcessor
now supports sending diagnostic data to LaunchDarkly regarding the OS version, performance statistics, etc. The exact implementation of this is determined by the platform-specific SDKs (.NET or Xamarin).- The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
- A bug in the SDK prevented the sending of events from being retried after a failure. The SDK now retries once after an event flush fails as was intended.
- The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
IUserBuilder.Secondary
is a new name forSecondaryKey
(for consistency with other SDKs), and allows you to make thesecondary
attribute private.User.Secondary
(same asSecondaryKey
).
IUserBuilder.SecondaryKey
,User.SecondaryKey
.
LdValue.Equals()
incorrectly returned true for object (dictionary) values that were not equal.- Summary events incorrectly had
unknown:true
for all evaluation errors, rather than just for "flag not found" errors (bug introduced in 2.9.0, not used in any current SDK).
- Fixed an exception when serializing user custom attributes in events (bug in 2.9.0).
EvaluationReason
static methods and properties for creating reason instances.LdValue
helpers for dealing with array/object values, without having to use an intermediateList
orDictionary
:BuildArray
,BuildObject
,Count
,Get
.LdValue.Parse()
. It is also possible to useNewtonsoft.Json.JsonConvert
to parse or serializeLdValue
, but since the implementation may change in the future, using the type's own methods is preferable.
EvaluationReason
properties all exist on the base class now, so for instance you do not need to cast toRuleMatch
to get theRuleId
property. This is in preparation for a future API change in whichEvaluationReason
will become a struct instead of a base class.
- Improved memory usage and performance when processing analytics events: the SDK now encodes event data to JSON directly, instead of creating intermediate objects and serializing them via reflection.
EvaluationReason
subclasses. Use only the base class properties and methods to ensure compatibility with future versions.
- Added
LaunchDarkly.Logging.ConsoleAdapter
as a convenience for quickly enabling console logging; this is equivalent toCommon.Logging.Simple.ConsoleOutLoggerFactoryAdapter
, but the latter is not available on some platforms.
IUserBuilder.AnonymousOptional
allows setting theAnonymous
property tonull
(necessary for consistency with other SDKs). See note about this under Fixed.
IUserBuilder
was incorrectly setting the user'sAnonymous
property tonull
even if it had been explicitly set tofalse
. Null and false behave the same in terms of LaunchDarkly's user indexing behavior, but currently it is possible to create a feature flag rule that treats them differently. SoIUserBuilder.Anonymous(false)
now correctly sets it tofalse
, just as the deprecated methodUserExtensions.WithAnonymous(false)
would.LdValue.Convert.Long
was mistakenly converting to anint
rather than along
. (#32)
- A packaging error made the
LaunchDarkly.CommonSdk.StrongName
package unusable in 2.6.0.
- Value type
LdValue
, to be used in place ofJToken
whenever possible.
- All event-related code except for public properties now uses
LdValue
.
- Internal helper type
ValueType
, unnecessary now because we can useLdValue.Convert
.
- Many improvements to XML documentation comments.
- Internal helper types
ValueType
andValueTypes
. - XML documentation comments are now included in the package for all target frameworks. Previously they were only included for .NET Standard 1.4.
- Internal types are now sealed.
- Changed some internal classes to structs for efficiency.
IBaseConfiguration
andICommonLdClient
interfaces.
IBaseConfiguration.EventCapacity
andIBaseConfiguration.EventFlushInterval
.UserBuilder.Key
setter.
IBaseConfiguration.SamplingInterval
.IBaseConfiguration.EventQueueCapacity
(now a synonym forEventCapacity
).IBaseConfiguration.EventQueueFrequency
(now a synonym forEventFlushInterval
).
User
constructors.User.Custom
andUser.PrivateAttributeNames
will be changed to immutable collections in the future.
User.Builder
provides a fluent builder pattern for constructingUser
objects. This is now the preferred method for building a user, rather than settingUser
properties directly or usingUserExtension
methods likeAndName()
that modify the existing user object.User.IPAddress
is equivalent toUser.IpAddress
, but has the standard .NET capitalization for two-letter acronyms.
User.IpAddress
(useIPAddress
).- All
UserExtension
methods are now deprecated. The setters for allUser
properties should also be considered deprecated, although C# does not allow these to be marked with[Obsolete]
.
- Fixed a build error that caused classes to be omitted from
LaunchDarkly.CommonSdk.StrongName
.
- The package and assembly name are now
LaunchDarkly.CommonSdk
, and theInternalsVisibleTo
directives now refer toLaunchDarkly.ServerSdk
andLaunchDarkly.XamarinSdk
. There are no other changes. All future releases of the LaunchDarkly server-side .NET SDK and client-side Xamarin SDK will use the new package names, and no further updates of the oldLaunchDarkly.Common
package will be published.
- Added support for planned future LaunchDarkly features related to analytics events and experimentation (metric values).
- Added support for planned future LaunchDarkly features related to analytics events and experimentation.
- It is now possible to deserialize evaluation reasons from JSON (this is used by the Xamarin client).
- The
IFlagEventProperties
interface was extended and modified to support the aforementioned features.
- Under some circumstances, a
CancellationTokenSource
might not be disposed of after making an HTTP request, which could cause a timer object to be leaked.
- The assemblies in this package now have Authenticode signatures.
This release was an error. It works, but there are no changes from 1.2.1 except for using a newer version of dotnet-eventsource
, which was also an unintended re-release of the previous version.
The only changes in this version are to the build:
- What is published to NuGet is now the Release configuration, without debug information.
- The Debug configuration (the default) no longer performs strong-name signing. This makes local development easier.
LaunchDarkly.Common
now has anInternalsVisibleTo
directive for an unsigned version of theLaunchDarkly.Client
unit tests. Again this is to support local development, since the client will be unsigned by default as well.
-
The non-strong-named version of this library (
LaunchDarkly.Common
) can now be used with a non-strong-named version ofLaunchDarkly.Client
, which does not normally exist but could be built as part of a fork of the SDK. -
Previously, the delay before stream 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, if the stream connection fails after it has been up for less than a minute, the reconnect delay will continue to increase. (changed in
LaunchDarkly.EventSource
3.2.0)
-
Fixed an unobserved exception that could occur following a stream timeout, which could cause a crash in .NET 4.0. (fixed in
LaunchDarkly.EventSource
3.2.0) -
A
NullReferenceException
could sometimes be logged if a stream connection failed. (fixed inLaunchDarkly.EventSource
3.2.0)
Incorporates the fix from 1.0.6 that was not included in 1.1.0.
- New
EvaluationDetail
andEvaluationReason
classes will be used in future SDK versions that support capturing evaluation reasons.
- Updated LaunchDarkly.EventSource to fix a bug that prevented the client from reconnecting to the stream if it received an HTTP error status from the server (as opposed to simply losing the connection).
- The reconnection attempt counter is no longer shared among all StreamManager instances. Previously, if you connected to more than one stream, all but the first would behave as if they were reconnecting and would have a backoff delay.
- Updated the dependency on
LaunchDarkly.EventSource
, which no longer has package references to System assemblies.
- The package
LaunchDarkly.Common
is no longer strong-named. Instead, we are now building two packages:LaunchDarkly.Common
andLaunchDarkly.Common.StrongName
. This is because the Xamarin project requires an unsigned version of the package, whereas the main .NET SDK uses the signed one. - The project now uses a framework reference (
Reference
) instead of a package reference (PackageReference
) to refer toSystem.Net.Http
. An unnecessary reference toSystem.Runtime
was removed. - The stream processor now propagates an exception out of its initialization
Task
if it encounters an unrecoverable error.
''This release is broken and should not be used.''
- When targeting .NET 4.5, the dependency on
Newtonsoft.Json
now has a minimum version of 6.0.1 rather than 9.0.1. This should not affect any applications that specify a higher version for this assembly.
- The
Identify
method is no longer part ofILdCommonClient
, since it does not have the same signature in the Xamarin client as in the server-side .NET SDK.
Initial release, corresponding to .net-client version 5.1.0.