Repository navigation
fix: Require C++ server SDK 3.15.0 so that track sends metric values correctly - #132
kinyoklion wants to merge 2 commits into
Conversation
…correctly Generated-by: termag
…e reasons Generated-by: termag
There was a problem hiding this comment.
A lot of these are because the C bindings are missing the ability to access rule IDs.
Some are from ambiguity between [] and {}.
Some are from dropped nils in fields.
Some are from not having an allFlagsState for bootstrap.
I am putting the suppressions in, and then we can choose to tackle these. They should almost all be pretty simple to handle.
- Extend the C bindings.
- Add meta-table information and construction methods to support disambiguation.
- Same as 2.
- Add all flags state.
All of these aren't high priority issues in standard usage of the SDK.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f7a042f. Configure here.
|
|
||
| local id = next_client_id | ||
| next_client_id = next_client_id + 1 | ||
| clients[id] = ld.clientInit(cfg.credential, timeout, make_config(cfg)) |
There was a problem hiding this comment.
Zero init wait treated as five seconds
Medium Severity
startWaitTimeMs of 0 is replaced with 5000 before clientInit. The Lua SDK treats 0 as return immediately without waiting, and the harness uses a zero wait so the client can stay uninitialized. Those requests instead block the single worker for five seconds and can finish initialized.
Reviewed by Cursor Bugbot for commit f7a042f. Configure here.
| client:track(params.eventKey, context, data) | ||
| else | ||
| client:track(params.eventKey, context) | ||
| end |
There was a problem hiding this comment.
Null custom event data is dropped
Medium Severity
opt() turns JSON-null event data into Lua nil, and track with a nil data argument calls TrackEvent instead of TrackData with JSON null. The omitNullData branch therefore has no effect: explicit null data is never sent as data: null.
Reviewed by Cursor Bugbot for commit f7a042f. Configure here.
beekld
left a comment
There was a problem hiding this comment.
I would take a look at those cursor comments, but otherwise, lgtm


Summary
With C++ server SDK versions before 3.15.0,
client:track(key, context, data, metric)sends the metric value as the event data and the data as the metric value (cpp-sdks#639). This raises the documented minimums to C++ server SDK 3.15.0 and Redis source 2.4.3, and moves the examples and CI to those versions.It also adds a test service for the SDK test harness in
contract-tests/, and a CI job that runs it. The service is an OpenResty app that runs the SDK from the checkout.test-suppressions.txtlists the 313 tests that fail today, and the README groups them by cause: missing reason fields in the C API,allFlagswithout the flags state, empty{}and[]that Lua tables cannot tell apart, and JSON nulls lost inside objects.Tested locally with C++ server SDK 3.15.0: with the suppressions, 5228 tests pass on harness v2.43.0 and 4705 on v2.42.0, and the Lua unit tests pass.
Opened from termag
Note
Overview
Raises the required C++ server-side SDK minimum to 3.15.0 and Redis source to 2.4.3 (CI env, README, and example Dockerfiles) so
client:trackwith a metric value is correct on the fixed C++ binding instead of older releases that swapped data and metric.Adds a
contract-tests/OpenResty service that implements the SDK test harness protocol, plustest-suppressions.txtfor 313 currently failing cases (documented gaps such as reason fields,allFlagsshape, Lua JSON{}/[], and null handling). CI gains acontract-testsjob that builds the service image and runs the shared contract-tests action with those suppressions.Reviewed by Cursor Bugbot for commit f7a042f. Bugbot is set up for automated code reviews on this repo. Configure here.