[Fusion] Add depth limit to satisfiability validator#9486
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a recursion depth guard to Fusion’s satisfiability validation to prevent stack overflows on large/cyclic schemas, with a regression test to cover the scenario.
Changes:
- Introduce a maximum recursion depth check in
SatisfiabilityValidator.VisitObjectType. - Track current traversal depth in
SatisfiabilityValidatorContext. - Add a stress/regression test that builds a large cyclic type graph across multiple schemas and asserts validation completes successfully.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs |
Adds depth tracking and a hard cutoff to avoid runaway recursion/stack overflow during satisfiability validation. |
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SatisfiabilityValidatorTests.cs |
Adds a test that constructs a large type cycle across multiple schemas to ensure validation doesn’t stack overflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs
Show resolved
Hide resolved
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs
Outdated
Show resolved
Hide resolved
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9486 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary of the changes (Less than 80 chars)