TypeScript: pushAll writes onto the store instead of replacing it (ts-flush-replaces-store) #136

Merged
libby merged 2 commits from libby/ts-flush-merges-onto-store into main 2026-11-12 09:47:34 +00:00
Member

Closes follow-up cultlib-gaps:follow_up:ts-flush-replaces-store.

SingleFileMessagePackBackingStore.pushAll replaced the whole file with the entries given, so CultMesh.flush() from a node created with pullOnStart: false (or with a stale image) left the store without the records it never read. It now reads the store under the lock and writes the entries onto it as push does: same-key records replaced, nothing else removed, retype refused by requireOneTypePerKey against the held records. Soft flush and the dangling-link case are unchanged. Same contract as Rust push_all (#135) and C#/Python.

Tests: store-level (replace by key, keep the rest, empty flush wipes nothing, retype refused byte for byte) and the reported scenario through CultMesh.startNode(..., {pullOnStart:false}).flush() (fails before). Three existing tests that used pushAll to reset a file now remove it first or expect the merge. cultcache-ts suite 93/93 with Rust, C#, Python interop; cultmesh-ts cultmesh.test 77/77.

🤖 Generated with Claude Code

Closes follow-up `cultlib-gaps:follow_up:ts-flush-replaces-store`. `SingleFileMessagePackBackingStore.pushAll` replaced the whole file with the entries given, so `CultMesh.flush()` from a node created with `pullOnStart: false` (or with a stale image) left the store without the records it never read. It now reads the store under the lock and writes the entries onto it as `push` does: same-key records replaced, nothing else removed, retype refused by `requireOneTypePerKey` against the held records. Soft flush and the dangling-link case are unchanged. Same contract as Rust `push_all` (#135) and C#/Python. Tests: store-level (replace by key, keep the rest, empty flush wipes nothing, retype refused byte for byte) and the reported scenario through `CultMesh.startNode(..., {pullOnStart:false}).flush()` (fails before). Three existing tests that used `pushAll` to reset a file now remove it first or expect the merge. cultcache-ts suite 93/93 with Rust, C#, Python interop; cultmesh-ts cultmesh.test 77/77. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TypeScript: pushAll writes onto the store instead of replacing it (ts-flush-replaces-store)
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
20d7c4a554
CultMesh.flush from a node that never pulled (or holds a stale image) wiped the records it never read. pushAll now merges onto the store under the lock, as push does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TypeScript: a flush persists the image as the stores hold it (legacy-key globals)
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 22m30s
309dab9a64
Soul finding on #136: merging pushAll left a legacy-key global under two keys, a store that does not reopen. storedSnapshot hands the global out under its stored key until its first write retires it; the readability walk now asserts nothing else is removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit b098d5b7da into main 2026-11-12 09:47:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!136
No description provided.