All notable changes to the LaunchDarkly C SDK will be documented in this file. This project adheres to Semantic Versioning.
- Fixed GCC 11 compiler diagnostic which prevented compilation using the default CMake configuration on Ubuntu 20.04 (thanks for the report, @yzabalotski!)
- Fixed handling of empty initial PUTs, which might occur if an environment has no flag or segment data.
- Fixed handling of out-of-order or stale flag updates. These updates are now discarded.
- Fixed serialization of private user attributes array in initial streaming/polling request payload.
- Fixed use-after-free when polling mode was used w/
REPORT
method (LDConfigSetUseReport
).
- Added contract test service.
- Added missing
track
andalias
methods to C++ headers.
- Fixed hang on Windows when
LDClientClose
was called after internet connection was dropped. - Fixed incorrect handling of configured URIs that contained trailing slashes.
- Fixed incorrect handling of optional properties in flag data.
- Fixed conversions of timestamps to JSON such that values are always represented as integers.
- Fixed an issue where
LDClientSaveFlags
would returnnull
if a flag was archived after initializing the SDK.
- Fixed an issue where
LDAllFlags
would returnnull
if a flag was archived after initializing the SDK in streaming mode.
- Added
LDSetClientStatusCallbackUserData
, which allows for passing avoid *userData
parameter. - Added documentation on
LDClientIdentify
, clarifying its asynchronous nature.
- Deprecated
LDSetClientStatusCallback
in favor ofLDSetClientStatusCallbackUserData
. Pass NULL as the user data parameter for equivalent usage.
- Added extra debug logging for CURL status codes when network requests fail.
- Fixes experimentation functionality. If an experiment is running, the SDK should now properly report flag evaluation reasons to the LaunchDarkly backend.
- Fixed generation of event payload ID header when assertions are disabled.
- Added documentation to C++ bindings, available in source and via Doxygen.
- Removed redundant
const
qualifiers in C++ bindings.
- Fixed deadlock triggered by interaction between LDClientIdentify and background threads. (Thank you, @juancampa.)
- Updated CircleCI configuration with new valgrind/drd jobs.
- Fixed Use-After-Free bug within
LDClientUnregisterFeatureFlagListener
- Fixed
uninitialized variable
compiler errors when compiled at-O3
. - Fixed streaming connection retry behavior when SDK was unable to resolve remote hostname.
- Added new CircleCI job to validate
-O3
build.
- Changed CircleCI macOS executors to Gen2 resource class.
- Allow macOS 11 build target to compile successfully using macOS 12 host.
- Fixed build issue on MacOS Monterey 12.1 due to deprecation of a symbol.
- Added a new configuration for request timeouts. Use
LDConfigSetRequestTimeoutMillis
to set the timeout for non-streaming requests. The default timeout is 30 seconds. This includes the total time for the request including connection. - Added a new method for configuring connection timeouts.
LDConfigSetConnectionTimeoutMillis
.
- Unit tests have been converted to use googletest.
- Fixed an issue where inactive stream connections could remain open indefinitely. Now streams will be closed after 5 minutes of inactivity and the SDK will attempt to establish a new connection.
- Deprecated
LDConfigSetConnectionTimeoutMillies
. TheLDConfigSetConnectionTimeoutMillis
method should be used instead.
- Add more restrictive build flags and fix warnings
- Added the
LDClientAlias
function. This can be used to associate two user objects for analytics purposes with analias
event. - Added the
LDConfigAutoAliasOptOut
function. This can be used to control the new behavior ofLDClientIdentify
. By passing trueLDClientIdentify
will not automatically generatealias
events.
- The
LDClientIdentify
method will now automatically generate an alias event when switching from an anonymous to a known user. This event associates the two users for analytics purposes as they most likely represent a single person.
- Relaxed internal locking to improve performance.
- Fixed the IP field of a user object leaking in certain situations
- Fixed the non allocating string variation not respecting result buffer limits
- Minor compiler warnings in MSVC
- Added code coverage reporting to CMake
- Better unit test coverage
- LDBasicLoggerThreadSafeInitialize used to setup LDBasicLoggerThreadSafe
- LDBasicLoggerThreadSafe a thread safe alternative to LDBasicLogger
- LDBasicLoggerThreadSafeShutdown to cleanup LDBasicLoggerThreadSafe resources
- Tests utilizing a mock HTTP server
- Resource cleanup on failed client initialization
- LDConfigSetConnectionTimeoutMillis configuration value being ignored
- Marked LDBasicLogger as deprecated
- OSX artifacts are now generated with Xcode 9.4.1
- Removed extra internal definition of LDi_statuscallback
- Create shared library artifacts for linux and mac (fixes #57)
- Added
LDUserSetCountry
. Thanks @mstrater !
- Windows artifacts are now released under both debug, and release configurations
- Windows release artifacts no longer include miscellaneous build files introduced by 2.0.2
- 2.0.0 Accidentally included the debug runtime on Windows. The debug runtime has been removed.
- Update DLLs to include metadata on Windows
- Redundant internal logic related to stream cancellation
- The
LDJSONVariation
, andLDJSONVariationDetail
variations now correctly handle empty objects, and arrays.
- A new JSON representation
struct LDJSON
and a large family of related functions. - A dedicated C++ wrapper class
LDClientCPP
- The
LDUserSetCustomAttributesJSON
function usingstruct LDJSON
to replaceLDUserAddPrivateAttribute
- A
LDLogLevel
enum for the new logging interface - A basic logging function that can be used instead of writing your own
LDBasicLogger
- The
LDConfigureGlobalLogger
used for configuring the logging function, and log level - The
LDLogLevelToString
function which convertsLDLogLevel
to a string
- Instead of
make
we now useCMake
to build the SDK. - The main include entrypoint is now
launchdarkly/api.h
instead ofldapi.h
- Previously the SDK defined either a class or struct depending on the language detected. Now there is a dedicated base C interface, and C++ wrapper.
- The types
LDClient
,LDConfig
, andLDUser
no longer use a typedef, and require thestruct
prefix. - The
stdbool.h
header have been removed from the public API. All instances ofbool
have been replaced withLDBoolean
which will contain a value of 0 or 1. - Updated the
LDUserSetPrivateAttributes
function to acceptstruct LDJSON
- Updated the
LDAllFlags
function to returnstruct LDJSON
- Updated the
LDJSONVariation
, andLDJSONVariationDetail
variations to usestruct LDJSON
- The entire public API now has a "defensive mode" enabled by default, which is controlled by the
LAUNCHDARKLY_DEFENSIVE
compile time definition. This mode will check, and log detectable errors of API usage. - Internal asserts can be controlled with the
LAUNCHDARKLY_USE_ASSERT
compile time definition.
- All old types and functions related to logging
- The
LDNode*
family of functions - The
LDNode
struct - The
LDConfigAddPrivateAttribute
function - The
LDUserSetCustomAttributesJSON
function - The
LDUserAddPrivateAttribute
function - The
LDClientGetLockedFlags
function - The
LDClientUnlockFlags
function - The
LD_store_*
family of functions
- Standardized streaming retry behavior. Previously exponential back-off was skipped.
- The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
- Artifacts are now released as zip / tar files containing both binaries and headers. No SDK code changes associated with this version bump.
- Stopped using
clock_gettime
on OSX which is not supported for older OS versions.
- Updated cJSON dependency to 1.7.12 (to resolve several known security vulnerabilities)
- Several race conditions in background threads causing lag when closing the client
- Increased validation of HTTP responses
- Simplified internal thread tracking logic
- Increased test coverage and documentation of variation methods
- Added
LDClientTrackMetric
which is an extended version ofLDClientTrackData
but with an extra associated metric value.
- Added the
LDConfigSetSSLCertificateAuthority
function. This can be used to specify an alternative certificate authority (such as your own private authority). (Thanks, Aditya Kulkarni!)
- Added the
LDUserFree
function. This can be used to free a user object before it has been passed to the client
- A leak of HTTP headers set for requests to LaunchDarkly
- A leak of the in memory flag store when
LDClientIdentify
is called. This was introduced in1.2.0
- A leak of a structure when events are flushed but no events need to be sent
- Added the
LDConfigSetVerifyPeer
configuration option. This option allows disabling certificate verification, which may be useful for testing, or in unfortunate networking configurations. Note that certificate verification should not be disabled unless it is essential, as it makes the SDK vulnerable to man-in-the-middle attacks. (Thanks, mstrater!)
- Fixed a bug where reconnecting in streaming mode sometimes erroneously waited for a timeout when switching users
- Renamed the build artifacts. They are now prefixed with
ldclientapi
. - Changed repository references to use the new URL.
There are no other changes in this release. Substituting the build artifacts from version 1.3.0 with the build artifacts from version 1.3.1 will not affect functionality.
The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now c-client-sdk
rather than c-client
. (Note that c-server-sdk
also exists, which is the server-side C/C++ SDK.)
The library name will also change. In the 1.3.0 release, it is still ldapi
; in all future releases, it will be ldclientapi
.
- Version string macro
LD_SDK_VERSION
inldapi.h
- Ensure
LDSetLogFunction
is properly exported in shared libraries
- Cleaned up exported symbols in shared libraries
- Added multiple environments support. It is now possible to evaluate flags in additional environments. You can add multiple secondary environments with
LDConfigAddSecondaryMobileKey
, and use an environment withLDClientGetForMobileKey
. - Added
LDNodeAppendHash
, andLDNodeAppendArray
- Exposed
LDConfigFree
(not needed in standard usage)
- Switched to bitflag comparison routines as per cJSON doc
- Memory leak of background thread stack
- Improved Windows build documentation
- Added logging on authorization failure
- Fixed a deadlock manifesting on Windows systems
- It is now possible to obtain information about how each feature flag value was determined (did the user match a target list or a rule, was the flag turned off, etc.). To do this, add
LDConfigSetUseEvaluationReasons(config, true)
to your configuration, and then callLD____VariationDetail
instea ofLD____Variation
when evaluating a flag. The "Detail" functions will fill in anLDVariationDetails
struct whosereason
field is a JSON data structure. SeeDOCS.md
and the SDK reference guide on "Evaluation reasons".
Initial release.