fix: isolate signatures array across QueryBuilder instances - #11
Open
seungjulee wants to merge 1 commit into
Open
seungjulee wants to merge 1 commit into
seungjulee wants to merge 1 commit into
Conversation
`QueryBuilder.from()` stored signatures in a shared mutable array. Each `withSignatures()` call pushed to the same array, so signatures accumulated across all derived instances. This broke queries using events with the same name but different parameter names (e.g. two ERC-20 Transfer variants with `uint256 tokens` vs `uint256 amount`). The second `withSignatures()` call contaminated the first instance's Driver, causing the wrong column names in queries. Fix: create an immutable snapshot of the signatures array for each `inner()` call, so each QueryBuilder instance gets its own copy.
seungjulee
force-pushed
the
fix/shared-signatures-mutation
branch
from
March 13, 2026 02:49
c526216 to
23b246a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
QueryBuilder.from()stores signatures in a shared mutable array. EachwithSignatures()call pushes to the same array, so signatures accumulate across all derived instances:This breaks queries for events that share the same event selector but differ in parameter names (e.g. ERC-20
Transferwithuint256 tokensvsuint256 amount). The Driver receives the accumulated list, so the wrong signature may be used for column name resolution, leading to errors likecolumn "amount" does not exist.Fix
Create an immutable snapshot of the signatures array for each
inner()call. EachQueryBuilderinstance now gets its own isolated copy of signatures:Reproduction
QueryBuilderviafrom()withSignatures()with signature A, use the returned builder for a querywithSignatures()with signature B (same event name, different param names)