Repository navigation
Rebuild structures from durable store when a save is declined (v2) - #187
Merged
Merged
Conversation
Port of the v1.11.x fix to v2. When saveStructures returns false (a concurrent writer updated the shared structures, or the host store transaction did not durably commit), the encoder's in-memory structures + transition trie may reference record ids that were never persisted. The existing re-pack reused the cached transition and re-emitted the same record pointing at an unpersisted structure -> "Record id is not defined for N" on a fresh reader. Mark structures uninitialized before the re-pack so it reloads durable structures via getStructures, rebuilds the trie, and re-mints + re-saves. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kriszyp
marked this pull request as ready for review
June 8, 2026 11:32
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.
Summary
v2 port of #186. When
saveStructuresreturnsfalse(concurrent shared-structures update, or the host store transaction did not durably commit), mark structures uninitialized before re-packing so the re-pack reloads durable structures viagetStructures, rebuilds the transition trie, and re-mints + re-saves — instead of re-emitting the same record referencing a structure id that was never persisted (→Record id is not defined for Non a fresh reader).See #186 (v1.11.x) for the full root-cause writeup and the paired host-side fix. One-line
pack.jschange + a regression test ("declined structure save re-packs against durable structures").🤖 Generated by Claude (Opus 4.7).