Skip to content

store: Support immutable entities in entity changes - #6742

Open
Grivn wants to merge 1 commit into
graphprotocol:masterfrom
Grivn:fix/immutable-entity-changes
Open

Grivn wants to merge 1 commit into
graphprotocol:masterfrom
Grivn:fix/immutable-entity-changes

Conversation

@Grivn

@Grivn Grivn commented Oct 16, 2026

Copy link
Copy Markdown

Fixes #4433.

entityChangesInBlock queries block_range for every table, but immutable entities store their creation block in block$. Any immutable entity in the schema therefore makes the query fail.

Use block$ to select immutable inserts and exclude immutable tables from the deletion query. Add PostgreSQL regressions for mixed mutable/immutable schemas and immutable-only schemas, including updates, deletions and blocks with no changes. Both new tests fail on master with the missing-column error and pass with this change.

Validation on macOS arm64 with PostgreSQL 18:

  • cargo fmt --all
  • just lint --locked -- -D warnings
  • cargo check --locked --release
  • cargo nextest run --locked --workspace --exclude graph-tests --test-threads 1 --no-fail-fast: 1,468 passed, 3 existing skips.
  • Workspace doctests: 3 passed, 5 existing ignores.

The regular just test-unit runner hit IPFS mock-server request-count failures; the workspace passes with nextest's process isolation. The CLI build test also returns early after an npm install error in this environment, so codegen/build was checked separately and the resulting Wasm module validated.

Select immutable inserts by their creation block and omit immutable
tables from deletion queries. Cover mixed and immutable-only schemas.

Fixes graphprotocol#4433.

This branch has not been deployed

No deployments
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.

diffEntitiesAtBlock in the index-node API fails for immutable entities

1 participant