Skip to content

fix: Ignore FDv2 objects with unrecognized kinds - #468

Merged
kinyoklion merged 3 commits into
mainfrom
rlamb/sdk-3340/fdv2-ignore-unknown-kinds
Oct 29, 2026
Merged

kinyoklion merged 3 commits into
mainfrom
rlamb/sdk-3340/fdv2-ignore-unknown-kinds

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

FDv2 SDKs must silently ignore objects of kinds they do not support, so new kinds can be added to payloads without breaking existing SDKs. The streaming and polling parsers passed any kind into the change set, and changes_to_store_data files every non-flag kind under segments, so an unknown-kind put replaced a real segment with the same key and an unknown-kind delete removed one. The parsers now skip put-object and delete-object events with an unsupported kind before from_h, so the object shape of a new kind cannot fail the payload either. A missing kind is still malformed, and known kinds are unchanged.

Tests

New specs in streaming_synchronizer_spec.rb and polling_payload_parsing_spec.rb mix unknown-kind puts and deletes with known objects and check only the known changes remain, with no warn/error logs on streaming (both failed before the change). spec/impl/data_system + spec/impl/data_store 220 examples, 0 failures; rubocop clean.

SDK-3340


Note

Overview
FDv2 put-object and delete-object events whose kind is not flag or segment are now skipped in both polling and streaming parsers, via new ProtocolV2.unsupported_kind?, so payloads can include future kinds without failing or mutating local state.

Previously, unknown kinds still entered the change set and were applied as segments in changes_to_store_data, which could overwrite or delete real segments by key.

Both paths also validate shape earlier: event data must be an object and kind must be a string (polling returns a failed result; streaming raises ArgumentError). Malformed events are still rejected; only unrecognized string kinds are ignored.

Reviewed by Cursor Bugbot for commit f60707b. Bugbot is set up for automated code reviews on this repo. Configure here.

put-object and delete-object events whose kind is not flag or segment
are now dropped by the streaming and polling parsers before the object
is decoded. Previously they were forwarded to the store, which filed
any non-flag kind under segments and could overwrite or delete a real
segment with the same key.
@kinyoklion
kinyoklion marked this pull request as ready for review October 19, 2026 22:53
@kinyoklion
kinyoklion requested a review from a team as a code owner October 19, 2026 22:53
@kinyoklion
kinyoklion requested a review from keelerm84 October 27, 2026 21:56
@kinyoklion
kinyoklion merged commit 168e199 into main Oct 29, 2026
10 checks passed
@kinyoklion
kinyoklion deleted the rlamb/sdk-3340/fdv2-ignore-unknown-kinds branch October 29, 2026 17:22
kinyoklion pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.20.0](8.19.1...8.20.0)
(2026-11-12)


### Features

* Add experimental support for flag overrides, read from local JSON or
YAML files or supplied by a custom override source
([9e2452c](9e2452c))
* Mark evaluations that a flag override affected with
`override_affected` in the evaluation reason, and count them under
separate summary counters
([9e2452c](9e2452c))


### Bug Fixes

* Ignore FDv2 objects with unrecognized kinds
([#468](#468))
([168e199](168e199))
* Make TestData value_for_all return its value when targeting is off
([#490](#490))
([dd484bb](dd484bb))

---
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**
> This PR **bumps the SDK from 8.19.1 to 8.20.0** via Release Please,
updating `LaunchDarkly::VERSION`, the release manifest, provenance
verification example, and **CHANGELOG** for the new release.
> 
> The **8.20.0** notes document what ships in this version:
**experimental flag overrides** (local JSON/YAML or a custom override
source), evaluation reasons tagged with **`override_affected`** plus
dedicated summary counters, ignoring **unrecognized FDv2 object kinds**,
and a **TestData** fix so `value_for_all` returns its value when
targeting is off.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4419601. 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants