Skip to content

Fix Fusion defer patches when delivery path crosses intermediate lists - #10189

Merged
michaelstaib merged 3 commits into
mainfrom
mst/fix-defer-patches-across-intermediate-lists
Aug 3, 2026
Merged

Fix Fusion defer patches when delivery path crosses intermediate lists#10189
michaelstaib merged 3 commits into
mainfrom
mst/fix-defer-patches-across-intermediate-lists

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 3, 2026 16:57

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

This PR fixes Fusion @defer incremental patch generation when the delivery path traverses one or more intermediate list fields, ensuring the pending path stops at the first list boundary and the emitted patches use subPath to address concrete list elements.

Changes:

  • Compute per-delivery-group “pending paths” that stop at the first list field, plus metadata used to build correct subPath values.
  • Rework incremental result creation to recursively emit patches for descendants under list elements (field/index subPath segments).
  • Add a regression test and snapshot covering defer delivery across intermediate lists.

Reviewed changes

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

File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanExecutor.cs Introduces delivery-path computation and updates incremental patch emission to correctly handle paths that cross list boundaries.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/DeferTests.cs Adds a regression test covering @defer delivery when the path crosses intermediate lists.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/DeferTests.Defer_Should_Return_Patches_When_Path_Crosses_Intermediate_Lists.yaml Captures the expected stable-stream response shape (pending path + per-element incremental patches).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

64.4% of changed lines covered (130/202)

File Covered Changed Patch %
…/src/Fusion.Execution/Execution/OperationPlanExecutor.cs 130 202 64.4% 🔴
Uncovered changed lines (JSON)
{
  "sha": "beb7fb287896fcfe50e6cafd4a80f86c0ca620f3",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanExecutor.cs", "ranges": [[772, 773], [777, 782], [785, 787], [797, 799], [841, 841], [843, 853], [855, 856], [859, 867], [872, 874], [881, 886], [889, 892], [895, 897], [899, 899], [901, 902], [923, 924], [1007, 1018], [1023, 1024]] }
  ]
}

Project coverage: 54.3% (242044/445363 lines)

@michaelstaib
michaelstaib merged commit 9cc107e into main Aug 3, 2026
7 of 8 checks passed
@michaelstaib
michaelstaib deleted the mst/fix-defer-patches-across-intermediate-lists branch August 3, 2026 19:58
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.

2 participants