feat(state): stamp createdAt/updatedAt on state-store records#462
Open
Mkassabov wants to merge 1 commit into
Open
feat(state): stamp createdAt/updatedAt on state-store records#462Mkassabov wants to merge 1 commit into
Mkassabov wants to merge 1 commit into
Conversation
State-store HTTP API (v6) now returns server-stamped `createdAt` / `updatedAt` ISO timestamps on every resource record. The Cloudflare Durable Object persists them unencrypted alongside the existing encrypted payload — `createdAt` is preserved across writes, `updatedAt` is refreshed on each `set`. Legacy entries written pre-v6 (bare encrypted string) are read transparently and re-shaped on the next write. The fields are scoped to the wire contract: the typed `HttpStateStore` client strips them before returning to the engine, so they never leak into `ResourceState` or downstream resource `attr` outputs. They're intended for HTTP-API consumers (e.g. CLI building `gc --older-than 14d` over a deployed store) that curl `/state/...` directly. Closes #427
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #427.
State-store HTTP API bumps to v6 and returns server-stamped
createdAt/updatedAtISO timestamps on every resource record.createdAtis preserved across writes,updatedAtis refreshed on everyset. Intended for HTTP-API consumers that curl the deployed store directly (e.g. a CLI buildinggc --older-than 14d).Scoped to the wire contract — the typed
HttpStateStoreclient strips both fields before returning to the engine, so they never leak intoResourceStateor downstream resourceattroutputs:Cloudflare DO persists them unencrypted alongside the existing encrypted payload, so a GC pass can read them without holding the key. Pre-v6 entries (bare encrypted string) decode transparently and get re-shaped on the next write.
Both
STATE_STORE_VERSIONconstants (State/HttpStateApi.tsandCloudflare/StateStore/Api.ts) move 5 → 6 so the bootstrap probe forces a worker redeploy.