Skip to content

feat!: Pass serialized items to persistent store cores - #564

Open
keelerm84 wants to merge 3 commits into
feat/10.xfrom
mk/SDK-3455/serialized-store-items
Open

keelerm84 wants to merge 3 commits into
feat/10.xfrom
mk/SDK-3455/serialized-store-items

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

FeatureStoreCore and AsyncFeatureStoreCore now take and return serialized items, which is how the persistent store interfaces in the Go SDK and js-core already work. Each item reaches a core as a new SerializedItemDescriptor, which holds the version, the deleted flag, and the item as an opaque JSON string. A core stores and returns these strings without knowing the data model.

CachingStoreWrapper and AsyncCachingStoreWrapper now handle serialization, tombstone encoding and version reconciliation. A core can store the version and the deleted state in their own fields, or only inside the serialized string. In the second case it returns a version of 0, and the wrapper reads both values from the string.

Breaking changes for custom store cores:

  • get_internal returns a SerializedItemDescriptor or None, and get_all_internal returns a mapping of keys to descriptors.
  • init_internal receives descriptors.
  • upsert_internal(kind, key, item) takes the key and a descriptor, and returns True if it applied the write. If the version check rejected the write, the wrapper re-reads the item, so the cache doesn't keep an older version.

VersionedDataKind gains serialize and deserialize helpers for core authors. The bundled Redis, DynamoDB and Consul cores, sync and async, now use the new interface.


Note

Overview
Persistent store cores (FeatureStoreCore / AsyncFeatureStoreCore) now exchange SerializedItemDescriptor (version, deleted flag, opaque JSON string) instead of plain dicts, matching Go and js-core. CachingStoreWrapper and AsyncCachingStoreWrapper own serialization, tombstone handling, and version reconciliation when a core stores only the JSON blob (version 0 means “read from string”).

Breaking changes for custom cores: init_internal and reads return descriptors; upsert_internal(kind, key, item) returns bool (applied vs rejected) instead of returning the winning item. On a rejected upsert, the wrapper re-reads the core when caching is enabled so stale entries are not kept. VersionedDataKind adds serialize / deserialize for version checks on string-only backends.

Bundled Redis, DynamoDB, and Consul cores (sync and async) are migrated; tests and ldclient/testing/serialized_items helpers follow the new contract.

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

@keelerm84
keelerm84 requested a review from a team as a code owner November 5, 2026 13:54

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 51618e8. Configure here.

Comment thread ldclient/feature_store_helpers.py Resolved
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