Skip to content

Keep visiting every operation when a callback removes or inserts operations (#2269, 3.x) - #551

Merged
lehni merged 1 commit into
3.xfrom
fix/2269-3x
Nov 5, 2026
Merged

lehni merged 1 commit into
3.xfrom
fix/2269-3x

Conversation

@lehni

@lehni lehni commented Nov 5, 2026

Copy link
Copy Markdown

Backport of #550 to 3.x, with the same tests adapted to mocha and expect.js.

Since 3.8.0, queries that mix withGraphJoined() and withGraphFetched() and select all columns of the root table return no fetched relations, without an error (Vincit/objection.js#2269). An onBuild() hook that removes operations, e.g. with clearSelect(), also made the query skip building the next operation, e.g. the where of findById(). Adding, removing and replacing root operations now creates a new array, and forEachOperation() starts over on it, skipping the operations it already visited.

@lehni
lehni merged commit 503b843 into 3.x Nov 5, 2026
8 checks passed
@lehni
lehni deleted the fix/2269-3x branch November 5, 2026 16:23
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