-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Handle null payloads. #497
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
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.
All tests now pass, so no suppressions are needed.
| return tl::unexpected(JsonError::kSchemaFailure); | ||
| } | ||
| // Check if the optional is empty (indicates null data) | ||
| if (!data->has_value()) { |
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.
Actual root fix.
| self->event_handler_->HandleMessage(event.type(), event.data()); | ||
| // TODO: Use the result of handle message to restart the | ||
| // event source if we got bad data. sc-204387 | ||
| auto status = |
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.
Secondary handle strange JSON and reconnect.
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.
If we just restart the stream when we encounter invalid JSON, then we could create a thundering-herd in the case the service somehow sent invalid JSON. So we defer the restart to the event source implementation. Which allows for it to incorporate back-off.
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-cpp-client: 3.11.0</summary> ## [3.11.0](launchdarkly-cpp-client-v3.10.1...launchdarkly-cpp-client-v3.11.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-internal bumped from 0.12.1 to 0.13.0 * launchdarkly-cpp-common bumped from 1.10.0 to 1.11.0 * launchdarkly-cpp-sse-client bumped from 0.5.5 to 0.6.0 </details> <details><summary>launchdarkly-cpp-common: 1.11.0</summary> ## [1.11.0](launchdarkly-cpp-common-v1.10.0...launchdarkly-cpp-common-v1.11.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) ### Bug Fixes * Correctly handle a wrapper name without a wrapper version. ([245dd97](245dd97)) </details> <details><summary>launchdarkly-cpp-internal: 0.13.0</summary> ## [0.13.0](launchdarkly-cpp-internal-v0.12.1...launchdarkly-cpp-internal-v0.13.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-common bumped from 1.10.0 to 1.11.0 * launchdarkly-cpp-networking bumped from 0.1.0 to 0.2.0 </details> <details><summary>launchdarkly-cpp-networking: 0.2.0</summary> ## [0.2.0](launchdarkly-cpp-networking-v0.1.0...launchdarkly-cpp-networking-v0.2.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) </details> <details><summary>launchdarkly-cpp-server: 3.10.0</summary> ## [3.10.0](launchdarkly-cpp-server-v3.9.1...launchdarkly-cpp-server-v3.10.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) * Add support for hooks. ([03e2a59](03e2a59)) ### Bug Fixes * Discard track events when the associated context is invalid. ([03e2a59](03e2a59)) * Handle null payloads. ([#497](#497)) ([d12b7a0](d12b7a0)) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-internal bumped from 0.12.1 to 0.13.0 * launchdarkly-cpp-common bumped from 1.10.0 to 1.11.0 * launchdarkly-cpp-sse-client bumped from 0.5.5 to 0.6.0 </details> <details><summary>launchdarkly-cpp-server-otel: 0.1.0</summary> ## 0.1.0 (2025-11-03) ### Features * Add tracing hook. ([#496](#496)) ([7eb5a2e](7eb5a2e)) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-server bumped from 3.9.1 to 3.10.0 </details> <details><summary>launchdarkly-cpp-server-redis-source: 2.2.1</summary> ## [2.2.1](launchdarkly-cpp-server-redis-source-v2.2.0...launchdarkly-cpp-server-redis-source-v2.2.1) (2025-11-03) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-server bumped from 3.9.1 to 3.10.0 </details> <details><summary>launchdarkly-cpp-sse-client: 0.6.0</summary> ## [0.6.0](launchdarkly-cpp-sse-client-v0.5.5...launchdarkly-cpp-sse-client-v0.6.0) (2025-11-03) ### Features * Add proxy support when using CURL networking. ([c9a6b17](c9a6b17)) * Add support for CURL networking. ([c9a6b17](c9a6b17)) ### Bug Fixes * Handle null payloads. ([#497](#497)) ([d12b7a0](d12b7a0)) ### Dependencies * The following workspace dependencies were updated * dependencies * launchdarkly-cpp-networking bumped from 0.1.0 to 0.2.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] > Publish workspace releases adding CURL networking with proxy support, server hooks, new server OTEL integration, and synchronized dependency/version updates. > > - **Releases**: > - **Client SDK `3.11.0`**: > - Features: CURL networking + proxy support. > - Deps: `launchdarkly-cpp-internal@0.13.0`, `launchdarkly-cpp-common@1.11.0`, `launchdarkly-cpp-sse-client@0.6.0`. > - Version constants/tests/CMake updated. > - **Server SDK `3.10.0`**: > - Features: CURL networking + proxy support; hooks support. > - Bug fixes: discard track events with invalid context; handle null payloads. > - Deps: bumped to internal/common/sse versions above. > - Version constants/tests/CMake updated. > - **SSE Client `0.6.0`**: CURL networking + proxy support; fix null payloads; dep on `launchdarkly-cpp-networking@0.2.0`. > - **Networking `0.2.0`**: add CURL networking + proxy support. > - **Common `1.11.0`**: add CURL networking + proxy support; fix wrapper name without version. > - **Internal `0.13.0`**: add CURL networking + proxy support; deps updated. > - **Server Redis Source `2.2.1`**: dep bump to `launchdarkly-cpp-server@3.10.0`; CMake/package version updates. > - **New: Server OTEL `0.1.0`**: tracing hook integration; dep on `launchdarkly-cpp-server@3.10.0`. > - **Repo**: > - `.release-please-manifest.json` updated to new versions across `libs/*`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5a6226c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Note
Validate null/malformed PATCH payloads as invalid and restart the SSE connection on invalid stream events; add broad tests and enable full contract tests.
patchevents with"data": nullor missing/invaliddataas schema failures, returningkInvalidMessage.kInvalidMessagefrom stream events, log andasync_restartthe SSE client with backoff.sse::Client::async_restart(reason)API and implement in both backends:FoxyClient: cancel stream, trigger backoff/reconnect.CurlClient: abort current transfer, trigger backoff/reconnect.data_source_event_handler_test.cpp.test-suppressions.txtandextra_paramsskips).Written by Cursor Bugbot for commit b6ebec5. This will update automatically on new commits. Configure here.