All notable changes to the LaunchDarkly Haskell Server-side SDK will be documented in this file. This project adheres to Semantic Versioning.
4.4.1 (2024-12-24)
4.4.0 (2024-12-05)
This release introduces the ability to enable compression of event payloads. When enabled, the SDK will compress events before sending them to the LaunchDarkly servers. This can reduce the bandwidth required to send events, which can be useful in high-traffic environments to reduce egress traffic costs.
Important
Relay Proxy users MUST upgrade to version 8.9 or higher prior to enabling this option to prevent loss of event data.
However, enabling this feature is NOT required when using the Relay Proxy as it will manage compression automatically.
4.3.0 (2024-10-24)
4.2.0 (2024-08-23)
4.1.0 (2024-03-18)
- Inline contexts for all evaluation events (#67) (654df01)
- Redact anonymous attributes within feature events (#68) (65a3f3d)
4.0.4 (2024-03-05)
4.0.3 (2024-02-07)
4.0.2 (2024-02-01)
- Eliminated unnecessary and noisy log message
The latest version of this SDK supports LaunchDarkly's new custom contexts feature. Contexts are an evolution of a previously-existing concept, "users." Contexts let you create targeting rules for feature flags based on a variety of different information, including attributes pertaining to users, organizations, devices, and more. You can even combine contexts to create "multi-contexts."
For detailed information about this version, please refer to the list below. For information on how to upgrade from the previous version, please read the migration guide.
- The type
Context
from theLaunchDarkly.Server.Context
module defines the new context model. - All SDK methods that took a hash representing the user now accept an
LDContext
. - Added support for Secure Mode.
- The
secondary
attribute which existed in the user hash is no longer a supported feature. If you set an attribute with that name inContext
, it will simply be a custom attribute like any other. - Analytics event data now uses a new JSON schema due to differences between the context model and the old user model.
- The minimum supported Stackage resolver is LTS 16.31.
- The default polling URL has changed from
https://app.launchdarkly.com
tohttps://sdk.launchdarkly.com
. - Several optimizations within the flag evaluation logic have improved the performance of evaluations. For instance, target lists are now stored internally as sets for faster matching.
- Removed the
User
type and all associated functions from theLaunchDarkly.Server.User
module. - Removed support for the
secondary
meta-attribute in the user hash. - The
alias
method no longer exists because alias events are not needed in the new context model. - The
configSetInlineUsersInEvents
configuration option no longer exists because it is not relevant in the new context model. - Removed all types and options that were deprecated as of the most recent 3.x release.
- The old Redis store integration has been removed from this repository and published to its own separate package. You can learn more by reviewing the Haskell redis docs or reviewing the published package on Hackage.
The following methods in TestData
have been deprecated and replaced with new context-aware options.
variationForAllUsers
was replaced withvariationForAll
valueForAllUsers
was replaced withvalueForAll
variationForUser
was replaced withvariationForKey
ifMatch
was replaced withifMatchContext
ifNotMatch
was replaced withifNotMatchContext
andMatch
was replaced withandMatchContext
andNotMatch
was replaced withandNotMatchContext
The config method configSetUserKeyLRUCapacity
has been deprecated and replaced with configSetContextKeyLRUCapacity
.
- The polling thread will be shutdown if the LaunchDarkly polling API returns an unrecoverable response code.
- Updated dependency versions in the Redis store package to mirror the SDK requirements.
- New
ApplicationInfo
type, for configuration of application metadata that may be used in LaunchDarkly analytics or other product features. This does not affect feature flag evaluations.
- Expanded upper version to allow
aeson-2.1
. (Thanks, vrom911) - Expanded upper version to allow
hashtables-1.3
. (Thanks, vrom911) - Expanded upper version to allow
mtl-2.3
. (Thanks, vrom911) - Expanded upper version to allow
text-2.0
. (Thanks, vrom911) - Expanded upper version to allow
time-1.12
. (Thanks, vrom911)
- Commit generated Cabal file per the stack recommendations (Thanks, philderbeast)
- Regenerated
.hlint.yaml
with defaults and counts (Thanks, philderbeast!)
- Fixed hlint "pattern parser error" lint. (Thanks, philderbeast!)
- Expanded upper version to allow lens 5.1. (Thanks, bmillwood!)
- Fixed Aeson 2.0 compatibility layer.
- Add flag support for the client side availability property, as well as the older the ability to decode from the older clientSide format.
- The new allFlagsState function should be used instead of allFlags if you are passing flag data to the front end for use with the JavaScript SDK. It preserves some flag metadata that the front end requires in order to send analytics events correctly. Versions 2.5.0 and above of the JavaScript SDK are able to use this metadata, but the output of allFlagsState will still work with older versions.
- It is now possible to inject feature flags into the client from local JSON files, replacing the normal LaunchDarkly connection. This would typically be for testing purposes. See LaunchDarkly.Server.Integrations.FileData.
- LaunchDarkly.Server.Integrations.TestData is another new way to inject feature flag data programmatically into the SDK for testing—either with fixed values for each flag, or with targets and/or rules that can return different values for different users. Unlike FileData, this mechanism does not use any external resources, only the data that your test code has provided.
- CI builds now include a cross-platform test suite implemented in https://github.com/launchdarkly/sdk-test-harness. This covers many test cases that are also implemented in unit tests, but may be extended in the future to ensure consistent behavior across SDKs in other areas.
- The SDK will track the last known server time as specified in the Date header when sending events. This value, along with the current system time, will be used to determine if debug event should still be sent.
- VariationIndex has been changed from Natural to Integer.
- When evaluating against a user attribute, if the attribute is null, it should always be treated as a non-match.
- The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
- Updated dependency ranges. Thanks @dbaynard !
- Added the
alias
function. This can be used to associate two user objects for analytics purposes by generating an alias event.
- Removed unused legacy "sel" field from flag model.
- Expanded dependency supported version range. Thanks @dbaynard!
- The function
userSetKey
is now takesText
instead ofMaybe Text
for the key. This originally existed for compatibility with an internal test suite.
- The constructor
EvalErrorUserNotSpecified
has been removed fromEvalErrorKind
.
- Widened time and lens dependency ranges. Thanks @nbouscal!
- Standardize streaming retry behavior. Changed handling of status codes. Exponential back-off is now reset after 60 seconds of successful streaming.
- Added a timeout on SSE reads to 5 minutes.
- Fixed an issue where reading SSE streams would burn CPU in certain edge cases
- Client initialization status is now correctly determined by checking the feature store instead of an always in memory value. This is particularly important for usage of daemon mode. In the current implementation daemon mode evaluation always returns the default fallback value because the client never becomes initialized.
- Several haddock typos.
- Added
configSetStoreTTL
, andconfigSetUseLdd
toLaunchDarkly.Server
export list. - Added
package.yaml
version constraints.
- Added an event delivery retry mechanism. The SDK will now try to deliver events again after one second before dropping them.
- Added a payload identity header for event delivery to prevent duplication in certain edge cases.
- Made many fields strict for more deterministic memory usage.
- Added support for utilizing external features stores. See
LaunchDarkly.Server.Store
for details on implementing a store. You can configure usage of a specific store withconfigSetStoreBackend
. - Added support for Redis as an external feature store. See the
launchdarkly-server-sdk-redis
package for details. - Added support for LaunchDarkly daemon mode configurable with
configSetUseLdd
. To learn more, read Using daemon mode.
- Incorrect ToJSON instances for flag rules and operators.
- Updated bucketing logic to fallback to last variation instead of producing an error.
- Refactored streaming implementation.
- Stopped sending empty event payloads.
- Corrected internal HTTP client user agent format.