Skip to content

fix: Ignore FDv2 put-object and delete-object events with unsupported kinds - #2109

Open
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/sdk-3341/fdv2-ignore-unknown-kinds
Open

kinyoklion wants to merge 1 commit into
mainfrom
rlamb/sdk-3341/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 protocol handler checked the kind on put-object (with a warning per object) but not on delete-object, so an unknown-kind delete reached the server payload listener: the in-memory store kept it under an unknown namespace, and the persistent store wrapper threw in sortDataSet during init, leaving the store unavailable. Put-object and delete-object now drop kinds without a registered processor at debug level. The check is an own-property lookup, so kinds such as constructor or __proto__ no longer resolve to inherited object members. A supported kind whose processor rejects the object still warns.

Tests

protocolHandler.test.ts covers unknown puts and deletes mixed with known objects, built-in member names as kinds, and the known-kind rejection warning; PollingProcessorFDv2.test.ts (server) and StreamingFDv2Base.test.ts (client) check only known updates are delivered with no warnings. common 642/642, sdk-server 1551 passed / 7 skipped, sdk-client 874/874; oxlint and oxfmt clean.

SDK-3341. Covers the delete-object and sortDataSet items of SDK-3086; its remaining persistence hardening is not part of this change.


Note

Overview
FDv2 protocol handling now treats unknown object kinds the same on put-object and delete-object: events whose kind has no registered processor are dropped at debug (not warn), so future payload kinds do not break older SDKs or poll into the data store.

Supported-kind filtering uses an own-property check on objProcessors, so kinds like constructor or __proto__ no longer match inherited object members. Rejection by a processor for a known kind still warns and drops the object.

Tests cover mixed supported/unsupported streams, inherited member names, processor rejection, and end-to-end streaming/polling paths (only known updates delivered, no warn/error logs).

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

… kinds

The FDv2 protocol handler now drops put-object and delete-object events
whose kind has no registered object processor, logging at debug level.
Previously an unsupported kind on put-object was dropped with a warning,
and on delete-object it was forwarded into the payload, where the server
SDK applied it to the data store and a persistent store failed to write
it. Kind lookup uses an own-property check so kinds that name inherited
object members are not treated as supported.
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 31476 bytes
Compressed size limit: 31500
Uncompressed size: 149622 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34140 bytes
Compressed size limit: 35000
Uncompressed size: 122071 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25998 bytes
Compressed size limit: 44000
Uncompressed size: 167978 bytes

@kinyoklion
kinyoklion marked this pull request as ready for review October 19, 2026 22:54
@kinyoklion
kinyoklion requested a review from a team as a code owner October 19, 2026 22:54

This branch has not been deployed

No deployments
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.

1 participant