Skip to content

Fix Federated Event Stream subscription teardown on per-event errors - #9995

Merged
michaelstaib merged 3 commits into
mainfrom
mst/fusion-robustness
Jun 27, 2026
Merged

Fix Federated Event Stream subscription teardown on per-event errors#9995
michaelstaib merged 3 commits into
mainfrom
mst/fusion-robustness

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 27, 2026 21:12

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 Federated Event Stream subscription behavior so that per-event failures (e.g., enrichment lookup errors, including transport failures) produce an error result for that event without tearing down the overall subscription stream, allowing subsequent events to still be delivered.

Changes:

  • Adjust subscription event execution cancellation handling to distinguish “completed early due to root null-propagation” from genuine timeouts/aborts, keeping the stream alive for later events.
  • Improve error/data-path resolution in result integration by handling null intermediates and ignoring inline-fragment segments when mapping source error paths.
  • Add targeted regression tests covering per-event enrichment failures (lookup error + transport error), plus broader query/mutation error-behavior coverage and an HTTP+NATS end-to-end subscription scenario.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Subscriptions/EventStreamTransportFailureTests.cs New unit test ensuring transport-style enrichment failure yields per-event error and subscription remains alive.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Subscriptions/EventStreamLookupFailureTests.cs New unit test ensuring subgraph error/null lookup result yields per-event error and stream continues.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/QueryErrorBehaviorTests.cs New ASP.NET Core test coverage for query error behavior (root transport failure + coercion error).
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/MutationErrorBehaviorTests.cs New ASP.NET Core test coverage for mutation error behavior across multiple failure categories.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/EventStreamEnrichmentErrorOverHttpTests.cs New end-to-end test verifying per-event enrichment errors over HTTP with NATS JetStream don’t close the subscription.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.cs Adjust result/error-path integration to treat null intermediates as null (not undefined) and skip inline-fragment segments when resolving error tries.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanExecutor.cs Update subscription response streaming loop to avoid tearing down on root-null early completion and to replace per-event CTS when needed.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/ExecutionState.cs Track “processing completed early” and allow swapping the CTS that CancelProcessing() affects for per-event subscription scoping.

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

Comment thread src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanExecutor.cs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (30/30)

File Covered Changed Patch %
…/Fusion/src/Fusion.Execution/Execution/ExecutionState.cs 4 4 100.0% 🟢
…/src/Fusion.Execution/Execution/OperationPlanExecutor.cs 22 22 100.0% 🟢
…/src/Fusion.Execution/Execution/Results/FetchResultStore.cs 4 4 100.0% 🟢

Project coverage: 52.4% (215348/411052 lines)

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ michaelstaib
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@michaelstaib
michaelstaib merged commit e693a7f into main Jun 27, 2026
5 of 6 checks passed
@michaelstaib
michaelstaib deleted the mst/fusion-robustness branch June 27, 2026 21:31
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.

4 participants