Skip to content

Conversation

rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Jun 17, 2025

  • Add cellId to ExecutionCompleted and ExecutionCancelled event schemas
  • Remove ctx.query() calls from materializers to make them pure functions
  • Update all event commits to include cellId in the payload
  • This fixes LiveStore.UnexpectedError about materializer hash mismatch

The issue was that materializers were using ctx.query() to look up cellId during materialization, making them non-deterministic. LiveStore requires materializers to be pure functions without side effects -- all data must be passed via the event payload.

… materializers deterministic

- Add cellId to ExecutionCompleted and ExecutionCancelled event schemas
- Remove ctx.query() calls from materializers to make them pure functions
- Update all event commits to include cellId in the payload
- This fixes LiveStore.UnexpectedError about materializer hash mismatch

The issue was that materializers were using ctx.query() to look up cellId
during materialization, making them non-deterministic. LiveStore requires
materializers to be pure functions without side effects, with all necessary
data passed via the event payload.
@rgbkrk rgbkrk merged commit 6e0fb4f into main Jun 17, 2025
3 checks passed
@rgbkrk rgbkrk deleted the no-side-effects-in-materializers branch June 17, 2025 18:39
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.

1 participant