Skip to content

Keep the query baseline from owning cached results (#117) - #124

Merged
ryanbliss merged 1 commit into
mainfrom
claude/peaceful-bardeen-isdb3a
Oct 8, 2026
Merged

ryanbliss merged 1 commit into
mainfrom
claude/peaceful-bardeen-isdb3a

Conversation

@ryanbliss

@ryanbliss ryanbliss commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Fixes #117.

QueryNode.lastEmittedState holds the server baseline but wasn't @ignore. After overlapping optimistic edits rolled back, reading it adopted the backend's cached result as the baseline's structural child. The next query that received the same cached object threw Current parent: QueryNode at key lastEmittedState. Requested parent: QueryNode at key state.

The baseline is bookkeeping, so it's now @ignore. No clone is needed. As a side effect, baseline-only updates during an overlapping edit no longer emit nodeChanged.

Tests

  • Regression test in QueryNode.spec.ts follows the issue's sequence. Without the fix it fails with the exact error from the issue.
  • npm run test: all pass except two retree-create CLI tests. Those fail only in this container, because its global NODE_PATH exposes ESLint and TypeScript. With NODE_PATH unset they pass.
  • Also ran npm run doctor and npm run lint:architecture.

First of a stack: #118, #122 and #123 follow as PRs based on this branch.

lastEmittedState is bookkeeping, not an owned child. Without @ignore,
reading it after an overlapping optimistic rollback adopted the
backend's cached result under the baseline, so the next query that
received the same object threw a structural parent error.

Claude-Session: https://claude.ai/code/session_01Us9f7SPLJUYScpdDnA8oM4
@ryanbliss
ryanbliss added this pull request to stack #128 October 8, 2026 21:18
@ryanbliss
ryanbliss merged commit f8ff7f4 into main Oct 8, 2026
3 checks passed
@ryanbliss
ryanbliss deleted the claude/peaceful-bardeen-isdb3a branch October 8, 2026 21:24
ryanbliss added a commit that referenced this pull request Oct 8, 2026
lastEmittedState is bookkeeping, not an owned child. Without @ignore,
reading it after an overlapping optimistic rollback adopted the
backend's cached result under the baseline, so the next query that
received the same object threw a structural parent error.

Claude-Session: https://claude.ai/code/session_01Us9f7SPLJUYScpdDnA8oM4
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.

Query baseline adopts cached results and breaks re-observation after optimistic rollback

2 participants