Repository navigation
fix: Prevent the C API from swapping track data and metric values - #639
Merged
Merged
Conversation
Generated-by: termag
kinyoklion
marked this pull request as ready for review
November 4, 2026 22:09
beekld
approved these changes
Nov 4, 2026
Merged
kinyoklion
pushed a commit
that referenced
this pull request
Nov 9, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-cpp-client: 3.13.0</summary> ## [3.13.0](launchdarkly-cpp-client-v3.12.0...launchdarkly-cpp-client-v3.13.0) (2026-11-04) ### Features * Add the FDv2 cache initializer and per-context freshness to the client ([#613](#613)) ([a33e3f0](a33e3f0)) * Add the FDv2 data source orchestrator to the client SDK ([#612](#612)) ([7633334](7633334)) ### Bug Fixes * Prevent the C API from swapping track data and metric values ([#639](#639)) ([b363019](b363019)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-internal bumped from 0.15.0 to 0.16.0 </details> <details><summary>launchdarkly-cpp-internal: 0.16.0</summary> ## [0.16.0](launchdarkly-cpp-internal-v0.15.0...launchdarkly-cpp-internal-v0.16.0) (2026-11-04) ### Features * Add the FDv2 data source orchestrator to the client SDK ([#612](#612)) ([7633334](7633334)) </details> <details><summary>launchdarkly-cpp-server: 3.15.0</summary> ## [3.15.0](launchdarkly-cpp-server-v3.14.0...launchdarkly-cpp-server-v3.15.0) (2026-11-04) ### Features * Add the FDv2 data source orchestrator to the client SDK ([#612](#612)) ([7633334](7633334)) ### Bug Fixes * Prevent the C API from swapping track data and metric values ([#639](#639)) ([b363019](b363019)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-internal bumped from 0.15.0 to 0.16.0 </details> <details><summary>launchdarkly-cpp-server-dynamodb-source: 0.3.3</summary> ## [0.3.3](launchdarkly-cpp-server-dynamodb-source-v0.3.2...launchdarkly-cpp-server-dynamodb-source-v0.3.3) (2026-11-04) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.14.0 to 3.15.0 </details> <details><summary>launchdarkly-cpp-server-otel: 0.1.7</summary> ## [0.1.7](launchdarkly-cpp-server-otel-v0.1.6...launchdarkly-cpp-server-otel-v0.1.7) (2026-11-04) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.14.0 to 3.15.0 </details> <details><summary>launchdarkly-cpp-server-redis-source: 2.4.3</summary> ## [2.4.3](launchdarkly-cpp-server-redis-source-v2.4.2...launchdarkly-cpp-server-redis-source-v2.4.3) (2026-11-04) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/cpp-server bumped from 3.14.0 to 3.15.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Release Please cut that **bumps published versions** across the monorepo (manifest, `CMakeLists.txt`, `package.json`, embedded `Version()` strings, and matching test expectations) and **adds changelog entries** for work already on `main`. > > **Client `@launchdarkly/cpp-client` 3.13.0** (depends on **internal 0.16.0**): documents **FDv2 data source orchestration**, **FDv2 cache initialization with per-context freshness**, and a fix so the **C bindings no longer swap custom event JSON and metric values** on metric track calls. > > **Server `@launchdarkly/cpp-server` 3.15.0** picks up the same **FDv2 orchestrator** and **C API track/metric fix** via **internal 0.16.0**. **Redis**, **DynamoDB**, and **OTel** server add-ons are re-released with only a dependency bump to server **3.15.0**. > > There is **no new application logic in this diff**—only release metadata and documentation of prior merges. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8ff5cfd. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LDServerSDK_TrackMetricandLDClientSDK_TrackMetricpassed the metric value and the data toTrackin the wrong order. The implicit conversions betweenValueanddoublelet the call compile, so the event carried the metric value as its data, and the data converted to a number (usually 0) as its metric value. This affects every caller of these two C functions, including the Lua server-side SDK. The C++ API andLDServerSDK_TrackMetric_WithHookContextalready pass the values in the right order.Tested with new server and client C binding tests, which fail before this change and pass after it. The full server and client unit test suites pass.
Opened from termag
Note
Overview
LDClientSDK_TrackMetricandLDServerSDK_TrackMetricwere forwarding arguments to the underlyingTrackcall in the wrong order, so the numeric metric was stored as event data and theLDValuepayload was treated as the metric (often becoming0via implicit conversion). The C bindings now match the C++ API and the existingLDServerSDK_TrackMetric_WithHookContextpath: data first, thenmetric_value.Regression coverage adds a client test that subclasses
Clientto assert the received data and metric, and a server hook test that readsLDTrackSeriesContext_DataandLDTrackSeriesContext_MetricValueafterLDServerSDK_TrackMetric.Reviewed by Cursor Bugbot for commit f9f68b6. Bugbot is set up for automated code reviews on this repo. Configure here.