Skip to content

fix: Ignore FDv2 objects with unrecognized kinds - #541

Open
kinyoklion wants to merge 2 commits into
mainfrom
rlamb/sdk-3339/fdv2-ignore-unknown-kinds
Open

kinyoklion wants to merge 2 commits into
mainfrom
rlamb/sdk-3339/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. PutObject.from_dict and DeleteObject.from_dict converted kind with ObjectKind(kind), which raises for anything other than flag or segment: streaming treated the event as malformed and restarted the stream, and polling failed the whole payload. The streaming and polling parsers now skip put-object and delete-object events with an unsupported kind (debug log) before parsing them. A missing kind is still malformed, and known kinds are unchanged. The async data sources share these parsers.

Tests

test_ignores_objects_with_unknown_kinds in the streaming synchronizer and polling payload parsing tests mixes unknown-kind puts and deletes with known objects and checks the payload completes with only the known changes (both failed before the change). Full suite 1772 passed / 367 skipped; mypy, isort, pycodestyle clean.

SDK-3339


Note

Overview
FDv2 polling and streaming no longer treat unknown object kinds as fatal parse errors. The shared parsers in polling_common and streaming_common validate put-object / delete-object payloads (data must be an object, kind must be a string), then skip events whose kind is not in the SDK’s supported set via new has_unsupported_kind in protocolv2 (debug log only). Known flag / segment events behave as before.

Previously, ObjectKind(kind) inside PutObject.from_dict / DeleteObject.from_dict raised on future kinds—polling failed the entire payload and streaming went INTERRUPTED and retried. Async data sources inherit the fix because they use the same helpers.

Tests cover mixed unknown/known payloads completing successfully, plus explicit failures for non-object data or non-string kind.

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

put-object and delete-object events whose kind the SDK does not support are now dropped before the object is parsed, in both the streaming and polling FDv2 data sources. Previously the strict ObjectKind conversion raised, which interrupted the stream or discarded the whole polling payload. Known objects in the same payload are still applied.
@kinyoklion
kinyoklion marked this pull request as ready for review October 19, 2026 22:52
@kinyoklion
kinyoklion requested a review from a team as a code owner October 19, 2026 22:52
Comment thread ldclient/impl/datasystem/protocolv2.py Resolved
…se kind is not a string

These are malformed and now fail before the kind is checked, rather than raising from the kind check or being ignored as an unsupported kind.
@kinyoklion
kinyoklion requested a review from keelerm84 November 2, 2026 22:57
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