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.