Repository navigation
fix: Prevent a crash when track is called with nil data - #130
Merged
Merged
Conversation
Generated-by: termag
kinyoklion
marked this pull request as ready for review
October 30, 2026 23:07
beekld
approved these changes
Nov 4, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Nov 20, 2026
🤖 I have created a release *beep* *boop* --- ## [2.2.1](v2.2.0...v2.2.1) (2026-11-19) ### Bug Fixes * Prevent a crash when track is called with nil data ([#130](#130)) ([fa3e0d8](fa3e0d8)) * Require C++ server SDK 3.15.0 so that track sends metric values correctly ([#132](#132)) ([7bbc9cc](7bbc9cc)) * Require C++ server SDK 3.15.2 so that wrong-type evaluations record the default value in events ([#134](#134)) ([3043105](3043105)) --- 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** > Cuts **patch release 2.2.1** by sweeping version references from **2.2.0** through release tooling: `release-please` manifest, `CHANGELOG`, LuaRocks rockspecs (base + Redis) with `v2.2.1` source tags, `SDKVersion` in `launchdarkly-server-sdk.c`, helper scripts, README `luarocks make` examples, and example Docker `ARG VERSION` values. > > No new functional code appears in this diff; **2.2.1** is documented as fixing a **`track` crash when `data` is nil**, correct **metric** behavior via C++ server SDK **3.15.0+**, and **wrong-type evaluation events** recording defaults via C++ **3.15.2+** (those fixes ship in commits referenced by the changelog). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7a54ce2. 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> Co-authored-by: LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.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
client:track(key, context, nil)andclient:track(key, context, nil, metric)passed a NULL value to the C++ SDK, which dereferences it, so the process crashed. Without data or a metric,tracknow sends a custom event with nodatafield (track(key, context)used to send"data": null). A metric without data sends JSON null as the data, as the C API recommends.Tested with new
testTrackandtestTrackWithNilDatacases on LuaJIT: they segfault on the old binding and pass with this change.Opened from termag
Note
Overview
Fixes a segfault when
client:trackis called withnildata (with or without a metric), which previously forwarded a NULLLDValueinto the C++ SDK.The Lua
trackbinding now routes by what was passed: metric-only calls useTrackMetricwith JSON null when data is omitted; data-only calls useTrackData; key + context only useTrackEventso the payload has nodatafield (instead of"data": null). Docs note thatnildata can be used to send a metric without custom data.Adds
testTrackandtestTrackWithNilDatacovering these call shapes.Reviewed by Cursor Bugbot for commit 06991d8. Bugbot is set up for automated code reviews on this repo. Configure here.