-
Notifications
You must be signed in to change notification settings - Fork 3
feat: redis data source #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes handling of undefined variations in VariationOrRollout structures. Previously, the lack of a variation was treated as 0. Instead, there is a special case that variation must be defined or else a flag is malformed.
This significantly refactors the `Variation` internal calls to be much easier to reason about. In the process, it fixes some broken behavior which is now reflected in the suppressions list. It also refactors event generation to use the `EventScope`/`EventFactory` pattern found in other SDKs, such as Rust and Go.
This removes a bunch of duplicated work from the top-level typed Variation methods, and pushes it into the internal `Variation` method.
We had an infinite loop where the `Value` tag invoke deserializer was calling the `tl::expected<Value, JsonError` version, which called back to itself. This was manifesting as a runtime infinite loop. It's not caught by contract tests since I believe the trigger is having a list of variations that are themselves arrays, like: ``` "variations": [["a","b","c",123,true,"false"], [ .. other stuff ..], ... ] ``` The fix is to break the cycle and remove the incorrect implementation.
This moves all the `_ErrorInfo_` C bindings out of the client-side SDK and into the common library, allowing them to be shared with the server. This should be backwards compatible because the `sdk.h` includes the new `error_info.h`, providing the same symbols as before.
Adds a new README for the server. Also adds a link from the client-side README to this one. --------- Co-authored-by: Molly <molly.jones@launchdarkly.com>
I hadn't wired up the `DataStoreUpdater` component, so we were just inserting flag updates directly in the memory store. With this in place, we can remove the streaming update suppression.
Implements a set of C bindings for the server-side SDK. Missing are flag notifier bindings, but this isn't implemented in the C++ side yet either.
Hooks up the initial reconnect delay parameter to the server-side streaming data source. Allows us to remove another batch of contract test failures.
The argument to `ValidChar` is a `char`, so its max value is `255` rendering the check redundant. This causes a warning on our Mac compilations as well as a linter warning. --------- Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
| # ./scripts/build-release launchdarkly-cpp-client | ||
|
|
||
| set -e | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more a general issue that we build targets independently, but we require the full cmake configuration step to do so.
Might make sense to go further down this path and add LD_BUILD_SERVER and LD_BUILD_CLIENT so we can speed up CI / disable unnecessary work for people who don't want it.
| auto result = | ||
| boost::json::value_to<tl::expected<std::optional<Item>, JsonError>>( | ||
| json_val); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: make an actual tag_invoke deserializer for this.
4d0283e to
2c28a45
Compare
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
This implements a Redis data source for the server-side SDK.
When using this source, the SDK operates in what was previously known as "daemon mode". It treats Redis as read-only, loading data on-demand into an in-memory cache.
There is no connection to LaunchDarkly when using a Redis data source. That'll come later, when Redis will be able to be used as a destination.