Releases: configcat/.net-sdk
Releases · configcat/.net-sdk
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.
v7.2.0
- Introduced a new local dictionary override factory method:
Where the
FlagOverrides LocalDictionary(IDictionary<string, object> dictionary, bool watchChanges, OverrideBehaviour overrideBehaviour)
watchChanges
parameter indicates whether the SDK should rebuild the overrides upon each read to keep track of the source dictionary's changes. - Fix config fetcher-related error logging to include exception in the log if any.
v7.1.0
- Add new evaluation methods
GetAllValueDetails
/GetAllValueDetailsAsync
. - Fix logging in
ConfigServiceBase.SetOnline
. - Correct behavior of
GetAllXXX
methods soFlagEvaluated
event is also raised in case of error. - Correct reporting of "Config JSON is not present" errors and log them with error level also in the case of
GetAllXXX
methods. - Change implementation of
HttpConfigFetcher.FetchAsync
to execute only one fetch operation at a time. - Make
ProjectConfig
equality comparison consistent with other SDKs (treatsProjectConfig
instances with the same ETag equal regardless of actual content). - Make HTTP response handling consistent with other SDKs.
- Make
HttpConfigFetcher
-related error message consistent with other SDKs.
Breaking changes:
- Remove
BeforeClientDispose
hook.
v7.0.0
- Deprecate
ConfigCatClient
constructors in favor of the new static factory methodGet
,
which provides single client instances per SDK key. - Add convenience method
DisposeAll
for disposing all open clients at once. - Implement default user feature.
- Implement offline mode feature.
- Improve LazyLoad and AutoPoll refresh logic by taking the cache timestamp into account
to fetch the config only if cached config is unavailable or stale. - Add new evaluation methods
GetValueDetail
/GetValueDetailsAsync
,
which provide more detailed information about the evaluation result. - Add hooks (events), which provide notifications of the client's actions.
- Additional minor code quality and performance improvements.
- Update samples to .NET 6.
Breaking changes:
- Add new methods to the
IConfigCatClient
interface. - Change
ProjectConfig
to reference type with value equality (record). - Slightly change the behavior of ProjectConfig.TimeStamp (only updated when communication with the CDN servers succeeds, regardless of the returned status code).