Releases: configcat/.net-sdk
Releases · configcat/.net-sdk
v9.3.1
Bug fixes:
- Check cache expiration in every poll iteration, not just the first one in Auto Polling mode to reduce network traffic when the SDK uses a shared cache. (#98)
- Synchronize in-memory cache with the external cache in every poll iteration, not just the first one in Auto Polling mode regardless of offline mode to keep in-memory cache up-to-date when the SDK uses a shared cache.
v9.3.0
New features:
- Provide a new, more convenient way (
ConfigCatClientOptions.LogFilter
) for consumers to specify custom log event filter logic. (#95)
Improvements:
- Make the SDK trimmable and AOT-friendly by switching to source generated JSON serialization. Now it is compatible with AOT deployment models like NativeAOT, wasm-tools, IL2CPP, etc. (#94)
- Add support for Unity WebGL. (See
ConfigCatClient.PlatformCompatibilityOptions
and sample script files.) - Switch to source generated regular expressions for improving performance in .NET 8+ applications.
- Minor performance improvements (reduced memory allocation) around log messages and evaluation log building. (#95)
- Include additional clues in log messages when config fetching from CDN servers fails to make it easier to investigate issues. (#96)
v9.2.0
New features and improvements:
- Add methods ("snapshot API") which make it possible to synchronously evaluate feature flags/settings without block waiting for potential underlying I/O operations. At the same time, deprecate synchronous methods that may involve block waiting. (#81)
- Add a parameter named
CacheState
to the event args of theClientReady
event, by means of which consumers can get information about the initialization state of the client. - Define error codes (
EvaluationErrorCode
,RefreshErrorCode
) and expose them (EvaluationDetails.ErrorCode
,RefreshResult.ErrorCode
) to consumers so they can reliably identify the error type without resorting to guess it by checking the error message. (#86) - Introduce a new hook named
ConfigFetched
which can be used to observe config fetching-related errors even when refreshing is done by the SDK. - Add the missing
GetKeyAndValue
/GetKeyAndValueAsync
method to improve consistency with other SDKs. (#91)
Bug fixes:
- Make subscription to hook events thread-safe.
v9.1.0
Improvements:
- Make naming of
UserComparator
members consistent. (#89) - Adjust the terminology used in XML comments to the main documentation.
- Minor performance improvements. (#88)
Bug fixes:
- Use
HttpClientHandler.AutomaticDecompression
only when it's available (to support Blazor WASM). (#90) - Fix a few edge cases where user attribute values was not converted to their canonical string representations. (#88)
- Don't accept string arrays that contain null values in the case of ARRAY (NOT) CONTAINS ANY OF comparators.
- Allow leading/trailing whitespace in length prefix for (NOT) STARTS/ENDS WITH ANY OF comparators to align behavior with other SDKs. (#89)
- Align evaluation logging and evaluator error reporting in some edge cases where the config JSON contains errors.
- Correct grammar mistakes in error messages.
Breaking changes:
- Change the name of some
UserComparator
members:Is(Not)OneOf
->TextIs(Not)OneOf
,SensitiveIs(Not)OneOf
->SensitiveTextIs(Not)OneOf
,(Not)ContainsAnyOf
->Text(Not)ContainsAnyOf
. (Low impact expected.)
v9.0.1
v9.0.0
New features and improvements:
- Add support for the new Config JSON v6 format: update the config model and implement new features in setting evaluation logic. (#75)
- Overhaul setting evaluation-related logging and make it consistent across SDKs.
- Significant performance improvements to setting evaluation, especially when info level logging is turned off:
Method | LogInfo | Mean | Error | StdDev | Gen0 | Allocated |
---|---|---|---|---|---|---|
MatrixTests_ConfigV5 | False | 47.31 ms | 1.741 ms | 0.095 ms | 9909.0909 | 39.61 MB |
MatrixTests_ConfigV6 | False | 17.25 ms | 3.376 ms | 0.185 ms | 3468.7500 | 13.84 MB |
Bug fixes:
- Hook event handlers which close over the client instance should not prevent the client from being collected by the GC when user has no more references to the client instance. (#82)
- Fix a minor bug in the
Task.WaitAsync
polyfill: potential cancellation or exception needs to be propagated in every case. (#83) - Avoid making an unnecessary copy of the input string when deserializing JSON in .NET 4.5.
Breaking changes (listed in the order of expected impact):
- Change the type of the
User.Custom
property fromIDictionary<string, string?>
toIDictionary<string, object>
to allow other values thanstring
but disallownull
values. (#75) - The config JSON v5 format is no longer accepted by flag overrides. If you use this feature, you will need to convert your override JSON file(s) to the v6 format. You can do this using the
config-json convert v5-to-v6
command of the ConfigCat CLI tool. - Rename the
MatchedEvaluationRule
property toMatchedTargetingRule
and theMatchedEvaluationPercentageRule
property toMatchedPercentageOption
inEvaluationDetails
. - Throw
ArgumentException
when the SDK key passed toConfigCatClient.Get
is in invalid format (unless the client is set up to use local-only flag override behavior). - Change config model (
IConfig
and related interfaces/enums). - Slightly change the behavior of the
ClientReady
hook in Auto Poll mode to fire after the completion of the first fetch operation - regardless of success or failure - to make the behavior consistent with other SDKs. (#79) - Change the
User.AllAttributes
property into a method (GetAllAttributes
) as it allocates under the hood. - Revert
EvaluationDetails
andRefreshResult
from records to plain types as value equality is not implemented correctly (and it would not be really useful anyway).
v8.2.0
Bug fixes:
- Fix reported SDK version (removes Git commit hash from the version string).
- Fix error logging of
GetValue(Async)
/GetValueDetails(Async)
calls. - Fix XML documentation of
Comparator.Contains/NotContains
.
Breaking changes:
- Remove unintended setter of
IPercentageOption.VariationId
. (Very low impact expected.)
v8.1.1
v8.1.0
New features and improvements:
- Remove unnecessary package references (#71).
- Use a standardized config cache key generation algorithm and cache payload format to allow shared caches to be used by SDKs of different platforms.
- Enable deterministic (a.k.a. reproducible) build.
- Minor improvements to the XML documentation.
v8.0.0
Please note that this version comes with several breaking changes, so you may need to adjust your code when upgrading, especially if you're using deprecated APIs or a custom logger and/or cache implementation. You can find the detailed list of breaking changes below.
New features and improvements:
- Complete overhaul of SDK logging:
- Simplify the logger interface (
IConfigCatLogger
, formerlyILogger
) to make it easier to write custom implementations/adapters to logger frameworks. - Enable structured logging (for a demonstration of this concept, see this sample app).
- Include event IDs in log messages to make identification of log events easier.
- Revise log messages and make them consistent across the ConfigCat SDKs.
- Simplify the logger interface (
- Revise caching of downloaded config data:
- Change the cache interface (
IConfigCatCache
) to get and set the cache payload as a plain string to make it easier to write custom implementations by removing the burden of data serialization from implementers. Use a standardized config cache key generation algorithm and cache payload format to allow shared caches to be used by SDKs of different platforms.(The specification was slightly modified after this release, so support for standardized caching is actually available in v8.1.0.)
- Change the cache interface (
- Enable cancellation of async operations.
- Add nullable reference type annotations. (This may be a source breaking change if your project is configured to use NRTs and your code tries to pass nullable values in parameters marked as non-nullable to the SDK methods. Such errors, however, mean that your code is incorrect, you are just notified of the issues at compile-time instead of run-time.)
- Enable Source Link.
- Revise XML documentation.
- Minor performance improvements.
Bug fixes:
- Fix checks which ensure that
AutoPoll.PollInterval
,AutoPoll.MaxInitWaitTime
andLazyLoad.CacheTimeToLive
settings are in the valid range. (Also, make infinite init wait possible in the case of Auto Polling.) - Fix bug causing repeated refresh in the case of flag overrides configured to use a simplified config file data source.
- Fix potential version conflicts caused by the
System.Net.Http
package reference in .NET Framework targets (net45
andnet461
) by replacing the package reference with an assembly reference to the built-in version (v4.0.0), which is shipped as a part of the framework.
Breaking changes (listed in the order of expected impact):
- Remove all public constructors of
ConfigCatClient
and builder-style instantiation (ConfigCatClientBuilder
). Alternative:ConfigCatClient.Get
. Also removes the related configuration infrastructure (ConfigurationBase
,ConfigurationBuilderBase
and their subclasses). - Remove the
AutoPoll.OnConfigurationChanged
event. Alternative:ConfigCatClientOptions.ConfigChanged
. - Change the type of the
NewConfig
property fromProjectConfig
toIConfig
inConfigChangedEventArgs
. - Remove the
ILogger
interface. Alternative:IConfigCatLogger
. - Remove the
IConfigCache
interface. Alternative:IConfigCatCache
. - Remove the
GetVariationId
/GetVariationIdAsync
andGetAllVariationIds
/GetAllVariationIdsAsync
methods fromIConfigCatClient
/ConfigCatClient
. Alternative:GetValueDetails
/GetValueDetailsAsync
andGetAllValueDetails
/GetAllValueDetailsAsync
. - Slightly change the behavior of
GetValue
/GetValuesAsync
andGetValueDetails
/GetValuesDetailsAsync
to fail early with exception when these methods are called with invalid parameters:ArgumentNullException
whenkey
is null.ArgumentException
whenkey
is empty.ArgumentException
whenT
is not a supported type (string
,bool
,int
,long
,double
orobject
- both nullable and non-nullable).OperationCanceledException
whencancellationToken
is canceled during the operation (async methods only).
- The
ConfigCatClientOptions.Logger
andConfigCatClientOptions.PollingMode
are no longer initialized to a default instance but usenull
to specify that the default implementation should be used. - Remove the
ProjectConfig
,RolloutRule
andRolloutPercentageItem
classes from the public API. - Change the type of the
MatchedEvaluationRule
toITargetingRule
andMatchedEvaluationPercentageRule
toIPercentageOption
inEvaluationDetails
. - Add an optional
CancellationToken
parameter to the async methods ofIConfigCatCache
andIConfigCatClient
. - Change the return type of the following
IConfigCatClient
methods:GetAllKeys
/GetAllKeysAsync
(toIReadOnlyCollection<string>
) andGetAllValues
/GetAllValuesAsync
(toIReadOnlyDictionary<string, object?>
). - Slightly change the behavior of flag overrides so an unsupported value specified for a flag does not prevent overrides of other flags.
- Change the algorithm used to generate the config cache key and the format of the cache payload.