Skip to content

fix: Write a JSON tombstone for deleted items in the DynamoDB store - #269

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3638/dynamodb-json-tombstone
Nov 19, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3638/dynamodb-json-tombstone

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

The DynamoDB store wrote the item attribute of a deleted flag or segment as the string "null". Other SDKs that read the same table fail on it: the Go SDK and the Relay Proxy fail the whole read of the kind, Python's all() raises, Ruby raises, and PHP's getAllFeatures throws a TypeError.

The store now writes the tombstone JSON that the SDK passes in, {"version":N,"deleted":true}, the same as the Redis and Consul stores. If the serialized item is null, it builds the same JSON from the data kind. It still reads a "null" item as deleted, so tables written by older versions keep working. New unit tests cover the stored tombstone on upsert and init, and the legacy placeholder through get and getAll.

The contract test service uses the published DynamoDB store, so the persistent data store/dynamodb/read-write/data source deletions respect versioning suppression stays until a release with this fix is out and the service's store version is bumped. Against a local build of this store, that test passes on the v2 and v3 harness.

Opened from termag


Note

Overview
Fixes deleted-item persistence in the DynamoDB data store so deleted flags/segments are written as standard tombstone JSON ({"version":N,"deleted":true}) instead of the literal "null" string, matching Redis/Consul and keeping the table readable by other SDKs and Relay Proxy.

marshalItem now persists the SDK’s serialized tombstone when present, and synthesizes the same JSON via DataKind.serialize(ItemDescriptor.deletedItem(...)) when the serialized payload is null. unmarshalItem still treats legacy "null" values as deleted, so older table data keeps working.

New DynamoDbDataStoreImplTest cases assert tombstone JSON on upsert and init, null-serialized deletes, and legacy placeholder behavior through get and getAll.

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

The DynamoDB store wrote the string "null" as the item of a deleted flag or
segment. SDKs in other languages and the Relay Proxy fail a whole bulk read
on that value. Store the SDK's serialized tombstone ({"version":N,"deleted":true})
instead, as the Redis and Consul stores do. The store still reads "null" as a
deleted item, so tables written by older versions keep working.

Remove the contract test suppression for DynamoDB data source deletions.

Generated-by: termag
@keelerm84
keelerm84 marked this pull request as ready for review November 19, 2026 13:26
@keelerm84
keelerm84 requested a review from a team as a code owner November 19, 2026 13:26
@cursor cursor Bot added the risk:medium label Nov 19, 2026

@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.

Risk: medium.

Automated risk review (dry run): Medium

This PR would not be automatically approved. Human approval required.

Why: DynamoDbDataStoreImpl now writes JSON tombstones for deleted flags and segments instead of the string "null", which is a persistent-store write-format change that other SDKs and Relay read from the same table. Tests cover the new writes and legacy "null" reads, but this is still a medium-risk behavior change, so human approval is needed and no reviewers were assigned.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@keelerm84
keelerm84 merged commit abc1767 into main Nov 19, 2026
33 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3638/dynamodb-json-tombstone branch November 19, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants