Releases: configcat/elixir-sdk
Releases · configcat/elixir-sdk
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
custom
dictionary also allows attribute values other thanString
values. - 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-v6
command of the ConfigCat CLI tool. - Rename the
matched_evaluation_percentage_rule
property tomatched_targeting_rule
and thematched_evaluation_rule
property tomatched_percentage_option
inEvaluationDetails
. - 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_timeout
andread_timeout
options renamed toconnect_timeout_milliseconds
andread_timeout_milliseconds
to indicate the unit of measure (#80) - Cache: The
ConfigCache
behaviour 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 ownConfigCache
implementation 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_details
functions (see below). (#97) - Remove
on_changed
callback: Auto mode'son_changed
callback 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_seconds
option 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_user
option when starting ConfigCat, or you can useConfigCat.set_default_user/1
andConfigCat.clear_default_user/0
to 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
offline
option when starting ConfigCat or you can useConfigCat.set_offline/0
andConfigCat.set_online/0
to 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_details
andget_all_value_details
functions that returnEvaluationDetails
structs 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_id
property matches thename
property you specify when configuring multiple ConfigCat instances (defaults toElixir.ConfigCat
). Theevent_id
property 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_seconds
option: Auto mode now has amax_init_wait_time_seconds
option. 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
ConfigCache
implementation, this behaviour is the same as it always was. But if you're using a persistentConfigCache
implementation, 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_refresh
return value:ConfigCat.force_refresh/0
now 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_id
codes 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_only
mode: When using the:local_only
flag 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_timeout
andread_timeout
options 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_overrides
parameter to support the reading of flags & settings from a file or a map. - The evaluation logs were moved from
debug
level toinfo
level.
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
v1.0.0
Introducing a fully-fledged ConfigCat SDK for Elixir. <3
Special Thanks
Drover 🚗
For allowing me to work on this project and contribute directly to the community/Elixir's ecosystem.
Randy Coulman 🎖️
@randycoulman thanks a lot for joining me on this initiative. I've added you separately here because I know you've worked completely outside of your working hours on this project with me and making a fully-fledged Elixir SDK came 100% from your personal efforts.
InfluxData
Thanks again to @randycoulman and his team at InfluxData which gave us an initial version of this SDK so we didn't need to start entirely from scratch. Friends from InfluxData ❤️ :
ConfigCat Team
@laliconfigcat and his team for embracing the challenge with us, providing all the technical guidance required to make it happen.