Skip to content

[Fusion] Fix silently skipped lookups in batched operation plans - #10229

Merged
michaelstaib merged 3 commits into
mainfrom
mst/fix-skipped-entity-lookups
Aug 13, 2026
Merged

michaelstaib merged 3 commits into
mainfrom
mst/fix-skipped-entity-lookups

Conversation

@michaelstaib

@michaelstaib michaelstaib commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #10217

Copilot AI lite review requested due to automatic review settings August 12, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Fusion planning/execution behavior where nested entity lookups could be skipped (silently) in batched operation plans when sibling union-member selections differ, by making batching/grouping and dependency wiring deterministic and correctly optional for merged multi-target operations. This aligns with the reported issue (#10217) and adds regression coverage for both Fusion-internal lookups and Apollo Federation _entities flows.

Changes:

  • Assign fresh, deterministic execution node IDs for batch wrapper nodes and ensure root-node detection accounts for redirected step IDs (including de-duplication).
  • Treat dependencies as optional for batch nodes that contain either multiple operations or a single merged multi-target operation (planner + JSON plan parser).
  • Add/extend regression tests for the union-sibling differing-subselection scenario and update snapshots broadly to reflect the new deterministic ID assignment and node ordering.

Reviewed changes

Copilot reviewed 110 out of 110 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.BuildExecutionTree.cs Generates unique batch wrapper node IDs, stabilizes grouping order, updates root-node selection for redirected IDs, and adjusts dependency wiring rules for batch nodes.
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.Defer.cs Ensures deferred plan execution-node IDs start after plan step IDs to avoid collisions when building deferred execution nodes.
src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs Passes planSteps.NextId() into execution-plan building so wrapper nodes can allocate unique IDs beyond step IDs.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/Serialization/JsonOperationPlanParser.cs Deduplicates redirected dependencies and applies optional-dependency rules for merged multi-target batch nodes when parsing JSON plans.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/OperationBatchExecutionNode.cs Updates skip semantics so merged multi-target operations only skip when all their dependencies were skipped.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Planning/AbstractLookupFanoutPlanningTests.cs Adds regression tests and ID-collision guard for union-sibling nested lookups with differing sibling selections (Fusion + Apollo variants).
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Serialization/JsonOperationPlanSerializationTests.cs Adds coverage ensuring JSON formatting/parsing preserves optional dependency wiring and unique ID invariants for batch nodes.
src/HotChocolate/Fusion/test//snapshots/ Snapshot updates reflecting new deterministic wrapper IDs, dependency redirection, and node ordering across many planning/execution tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

94.8% of changed lines covered (73/77)

File Covered Changed Patch %
…/Execution/Nodes/OperationBatchExecutionNode.cs 8 12 66.7% 🔴
…/Execution/Nodes/Serialization/JsonOperationPlanParser.cs 11 11 100.0% 🟢
…/Planning/OperationPlanner.BuildExecutionTree.cs 46 46 100.0% 🟢
…/src/Fusion.Execution/Planning/OperationPlanner.Defer.cs 7 7 100.0% 🟢
…/Fusion/src/Fusion.Execution/Planning/OperationPlanner.cs 1 1 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "3172fd33c56ee7af346bbfde735df617073d8f86",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/OperationBatchExecutionNode.cs", "ranges": [[448, 449], [458, 458], [460, 460]] }
  ]
}

Project coverage: 54.4% (242613/445891 lines)

@michaelstaib
michaelstaib merged commit 293335a into main Aug 13, 2026
6 of 7 checks passed
@michaelstaib
michaelstaib deleted the mst/fix-skipped-entity-lookups branch August 13, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fusion: cross-subgraph entity lookup silently skipped when sibling inline fragments select the same field with differing sub-selections

2 participants