Skip to content

fix: Ignore FDv2 objects with unrecognized kinds - #468

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

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

Conversation

@kinyoklion

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

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.

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