Releases: configcat/elixir-sdk
Releases · configcat/elixir-sdk
v4.0.4
v4.0.3
v4.0.2
v4.0.1
v4.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.
- Overhaul setting evaluation-related logging and make it consistent across SDKs.
- The User's
customdictionary also allows attribute values other thanStringvalues. - Upgrade to Elixir 1.16
Breaking changes:
- 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-v6command of the ConfigCat CLI tool. - Rename the
matched_evaluation_percentage_ruleproperty tomatched_targeting_ruleand thematched_evaluation_ruleproperty tomatched_percentage_optioninEvaluationDetails. - Raise
ArgumentError "SDK Key is invalid."when the SDK key passed to ConfigCat.Client is in an invalid format (unless the client is set up to use local-only flag override behaviour).
v3.0.0
Breaking Changes
- Timeouts:
connect_timeoutandread_timeoutoptions renamed toconnect_timeout_millisecondsandread_timeout_millisecondsto indicate the unit of measure (#80) - Cache: The
ConfigCachebehaviour has been changed to store and retrieveString.t()cache entries (was previously amap()). This matches the new generalized cache implementation that is consistent for all ConfigCat SDKs. In addition, the format of the cache keys has been changed to be consistent with the other platforms. With these changes, you can now implement your ownConfigCacheimplementation in persistent storage (e.g. Redis) and share the cache amongst multiple language implementations. (#89) - Removed
get_variation_id/get_all_variation_ids: These functions have been removed in favour of the newget_value_details/get_all_value_detailsfunctions (see below). (#97) - Remove
on_changedcallback: Auto mode'son_changedcallback has been removed. Use the new Hooks feature instead (see below). (#99) - One instance per SDK key: When using multiple ConfigCat instances, each instance must be configured with a different SDK key. You must access all of your flags and settings through a single ConfigCat instance. (#108)
- Lazy cache policy:
cache_expiry_secondsoption has been renamed tocache_refresh_interval_seconds. (#110)
Added
- Default User: You can now possible to specify a default user to use when no user is passed to the various
get_*functions. You can pass thedefault_useroption when starting ConfigCat, or you can useConfigCat.set_default_user/1andConfigCat.clear_default_user/0to change the default user at any time. By default, there is no default user. (#80) - Online/Offline mode: You can now take ConfigCat offline to keep it from making HTTP calls to the ConfigCat server. When offline, ConfigCat will operate using its most recent cached config. You can pass the
offlineoption when starting ConfigCat or you can useConfigCat.set_offline/0andConfigCat.set_online/0to toggle between online and offline mode. You can query the current state withConfigCat.offline?/0. By default, ConfigCat is online. (#81) - get_value_details/get_all_value_details: Adds new
get_value_detailsandget_all_value_detailsfunctions that returnEvaluationDetailsstructs containing information about flag evaluations, including the key and value, whether or not the default value was returned, the user, the variation, and any matched rules. See the documentation for more details. (#96, #97) - Hooks: The new Hooks feature allows you to supply callback functions that are called by ConfigCat when significant events occur. See the documentation for more information. (#99)
- Logger metadata: All log messages include two additional pieces of information (when available) both in the log messages and as Logger metadata. The
instance_idproperty matches thenameproperty you specify when configuring multiple ConfigCat instances (defaults toElixir.ConfigCat). Theevent_idproperty is a numeric error code that is common to all of the ConfigCat language SDKs. If you want to use the metadata properties, you'll need to configure your Logger backend to include them. (#100) max_init_wait_time_secondsoption: Auto mode now has amax_init_wait_time_secondsoption. When ConfigCat first starts up, any calls to theget_*functions will wait for this many seconds for the initial config fetch to occur. If the fetch does not complete in time, the existing cached config (if any) will be used. Otherwise, the call will return the default value. Default: 5 seconds. (#102)- Module-based multiple instances: If you need to run multiple instances of ConfigCat, you can now use new module-based approach. See the documentation for more information. (#104)
Changed
- Use latest fetch time and ETag: The new generalized cache format (see above) now includes the time at which the config was last fetched as well as the cache-control ETag. ConfigCat now uses that fetch time when determining whether or not to fetch in Lazy mode and when to start polling in Auto mode and uses the last-received ETag when fetching. When using the default
ConfigCacheimplementation, this behaviour is the same as it always was. But if you're using a persistentConfigCacheimplementation, this means that ConfigCat can avoid re-fetching a new config when it starts up if the existing cached config is new enough and on the first fetch, the server can send back a 304 response if appropriate. (#90, #94) force_refreshreturn value:ConfigCat.force_refresh/0now returns{:error, String.t()}when it fails rather than leaking errors from HTTPoison. The typespec for that function has been tightened up accordingly. (#101)- Reduced server round-trips: When multiple processes attempt to fetch the config while a fetch is already in progress, all of the requests will be satisfied by the result of the in-progress fetch. Previously, each request would be serialized and result in a new request to the server. (#103)
- Consistent log messages: Log messages are now consistent with the other SDKs, including the new
event_idcodes described above. (#105) - Consolidated evaluation log: When evaluating a flag, a number of debug-level messages are logged. These messages are now collected together into a single log entry. (#107)
Fixed
- Last fetch time: When the server returns a 304 error, the last fetch time is now updated so that the next fetch request is delayed until the appropriate time. (#101)
- Errors in
local_onlymode: When using the:local_onlyflag overrides setting, some of the ConfigCat calls would fail with confusing error message. These calls are now handled cleanly, returning an appropriate result. (#105)
v2.0.1
v2.0.0
connect_timeoutandread_timeoutoptions were added to be able to configure HTTP timeout parameters.- A
get_all_values()function was added that evaluates all flags & settings in a map. - New
flag_overridesparameter to support the reading of flags & settings from a file or a map. - The evaluation logs were moved from
debuglevel toinfolevel.
v1.0.2
v1.0.1
Fixed
- Prevent GenServer calls from timing out during config fetch (#62) from @ischolten, @gspletzer, and @randycoulman
- In auto-polling mode, API calls no longer wait for an in-progress fetch (#62) from @ischolten, @gspletzer, and @randycoulman