Skip to content

Implement entity field comparison operators#898

Merged
DZakh merged 2 commits into
dz/test-indexer-with-vitestfrom
claude/add-field-comparison-logic-u5jHa
Jan 13, 2026
Merged

Implement entity field comparison operators#898
DZakh merged 2 commits into
dz/test-indexer-with-vitestfrom
claude/add-field-comparison-logic-u5jHa

Conversation

@DZakh

@DZakh DZakh commented Jan 13, 2026

Copy link
Copy Markdown
Member

No description provided.

Store decoded entities instead of JSON to enable proper comparison.
The previous implementation stored JSON values and compared them
directly, which fails for bigint and BigDecimal since they serialize
as strings. Now entities are parsed when received from the worker
thread, and comparisons use the TableIndices.FieldValue logic that
properly handles numeric type comparisons.
Use entityConfig.table field schema with S.convertOrThrow to parse
JSON field values instead of manual type-based parsing. This reuses
the existing schema infrastructure and follows the same pattern as
InMemoryTable for field value comparison.
@coderabbitai

coderabbitai Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DZakh
DZakh merged commit 7c93879 into dz/test-indexer-with-vitest Jan 13, 2026
0 of 2 checks passed
@DZakh
DZakh deleted the claude/add-field-comparison-logic-u5jHa branch January 13, 2026 15:36
DZakh added a commit that referenced this pull request Jan 14, 2026
* Replace mocha, chai and tsx with vitest

* Add testrust command

* Make erc20 template multichain

* Don't register test files as handlers

* Add ADR - why vitest

* Support Vitest with ReScript

* Codegen types

* Add validation to indexer.process call

* Add WorkerThreads bindings

* Modify rescript_types.rs to support TS

* Always return entity types capitalized

* First implementation

* Formatting update

* Make testIndexer.process return changes

* Improvements for test indexer

* Final touches

* Small clean up

* Try to fix ci tests

* Change internal.config.ts codegen to .json and .d.ts codegen

* Fixes after merge

* Silent logs for MockIndexer

* Implement entity field comparison operators (#898)

* Fix test indexer field comparison for bigint and BigDecimal

Store decoded entities instead of JSON to enable proper comparison.
The previous implementation stored JSON values and compared them
directly, which fails for bigint and BigDecimal since they serialize
as strings. Now entities are parsed when received from the worker
thread, and comparisons use the TableIndices.FieldValue logic that
properly handles numeric type comparisons.

* Simplify field comparison using schema-based conversion

Use entityConfig.table field schema with S.convertOrThrow to parse
JSON field values instead of manual type-based parsing. This reuses
the existing schema infrastructure and follows the same pattern as
InMemoryTable for field value comparison.

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Change ERC20 indexer test to use startBlock equal to endBlock (#899)

Instead of scanning from block 0, set startBlock to match endBlock
(10_861_674) for more efficient targeted block testing.

Co-authored-by: Claude <noreply@anthropic.com>

* Apply tsx for TestIndexer worker thread

* Final fixes

* Fix tsx in worker

* Fix erc20 test

* Increase mocha timeout to 30s for erc20_multichain_factory tests (#901)

Co-authored-by: Claude <noreply@anthropic.com>

* Iterate over update.history in TestIndexer.handleWriteBatch (#902)

Previously, handleWriteBatch only inspected update.latestChange, skipping
earlier entries in update.history. This change mirrors PgStorage.res behavior
by iterating over all history entries and applying Set/Delete logic for each.

Includes a fallback to process latestChange when history is empty for
backwards compatibility.

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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