Skip to content

Releases: configcat/.net-sdk

v8.0.0

26 May 18:58
775aa17
Compare
Choose a tag to compare

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, formerly ILogger) 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.
  • 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.)
  • 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 and LazyLoad.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 and net461) 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 from ProjectConfig to IConfig in ConfigChangedEventArgs.
  • Remove the ILogger interface. Alternative: IConfigCatLogger.
  • Remove the IConfigCache interface. Alternative: IConfigCatCache.
  • Remove the GetVariationId/GetVariationIdAsync and GetAllVariationIds/GetAllVariationIdsAsync methods from IConfigCatClient/ConfigCatClient. Alternative: GetValueDetails/GetValueDetailsAsync and GetAllValueDetails/GetAllValueDetailsAsync.
  • Slightly change the behavior of GetValue/GetValuesAsync and GetValueDetails/GetValuesDetailsAsync to fail early with exception when these methods are called with invalid parameters:
    • ArgumentNullException when key is null.
    • ArgumentException when key is empty.
    • ArgumentException when T is not a supported type (string, bool, int, long, double or object - both nullable and non-nullable).
    • OperationCanceledException when cancellationToken is canceled during the operation (async methods only).
  • The ConfigCatClientOptions.Logger and ConfigCatClientOptions.PollingMode are no longer initialized to a default instance but use null to specify that the default implementation should be used.
  • Remove the ProjectConfig, RolloutRule and RolloutPercentageItem classes from the public API.
  • Change the type of the MatchedEvaluationRule to ITargetingRule and MatchedEvaluationPercentageRule to IPercentageOption in EvaluationDetails.
  • Add an optional CancellationToken parameter to the async methods of IConfigCatCache and IConfigCatClient.
  • Change the return type of the following IConfigCatClient methods: GetAllKeys/GetAllKeysAsync (to IReadOnlyCollection<string>) and GetAllValues/GetAllValuesAsync (to IReadOnlyDictionary<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

11 Jan 11:21
a31fcfa
Compare
Choose a tag to compare
  • Introduced a new local dictionary override factory method:
    FlagOverrides LocalDictionary(IDictionary<string, object> dictionary, bool watchChanges, OverrideBehaviour overrideBehaviour)
    Where the 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

16 Dec 12:07
1601361
Compare
Choose a tag to compare
  • Add new evaluation methods GetAllValueDetails/GetAllValueDetailsAsync.
  • Fix logging in ConfigServiceBase.SetOnline.
  • Correct behavior of GetAllXXX methods so FlagEvaluated 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 (treats ProjectConfig 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

10 Nov 14:21
9e7a23b
Compare
Choose a tag to compare
  • Deprecate ConfigCatClient constructors in favor of the new static factory method Get,
    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).

v6.5.3

07 Sep 13:44
dcaf235
Compare
Choose a tag to compare
  • Use logger wrapper everywhere internally. #39
  • Improved evaluation logging. #38

v6.5.2

09 Aug 10:48
6dc6228
Compare
Choose a tag to compare
  • Consolidate percentage rule evaluation logs.

v6.5.1

07 Apr 08:46
326f208
Compare
Choose a tag to compare
  • Add net461 to the target frameworks list to force the usage of System.Text.Json rather than Newtonsoft.Json.

v6.5.0

06 Apr 09:53
bbd3e51
Compare
Choose a tag to compare
  • Replace FileSystemWatcher with file polling in the local file override data source when auto-reload is turned on.

v6.4.12

04 Apr 08:49
ddb18a0
Compare
Choose a tag to compare
  • Fix the file is used by another process issue that occured when the watched override file was modified.

v6.4.9

04 Mar 16:01
Compare
Choose a tag to compare
  • Move the PollingMode option to public scope.