Skip to content

Fix stale cache after move operation - #58

Merged
chm-diederichs merged 3 commits into
mainfrom
undo-bust-cache
Jul 29, 2026
Merged

Fix stale cache after move operation#58
chm-diederichs merged 3 commits into
mainfrom
undo-bust-cache

Conversation

@chm-diederichs

@chm-diederichs chm-diederichs commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
  • WriteBatch serialization renumbers pointer objects in place (k.seq/k.offset = ), and those objects are shared into older nodes' delta lists through CompressedArray.commit(). The decoder rebuilds nodes purely from their own block's delta list, so the in-memory delta is what gets serialized. The design assumption is that an old node object is never re-serialized after a newer flush and autobee's undo (move() to an older length) violates exactly that: the node cache hands back the old root object whose delta pointers now reference the newer, just-abandoned block, and the post-undo re-apply flushes garbage references to disk.

  • commit()'s slice(0, -this.updates) with updates === 0 (slice(0, -0) = slice(0, 0)) wipes the live node's delta

claude opus 4.8

@chm-diederichs
chm-diederichs requested a review from a team July 28, 2026 20:03
@chm-diederichs
chm-diederichs merged commit 956f7a5 into main Jul 29, 2026
4 checks passed
@chm-diederichs
chm-diederichs deleted the undo-bust-cache branch July 29, 2026 07:07
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.

2 participants