Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses “Expression is always true” warnings by removing redundant null checks and adding targeted analyzer suppressions where runtime nullability differs from the declared API contract.
Changes:
- Removed redundant null checks and simplified assertions that are always true under current nullability contracts.
- Added ReSharper suppressions for nullable-flow warnings that can’t be expressed cleanly with current type annotations.
- Simplified root type resolution in the execution pipeline.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mocha/src/Mocha/Runtime/MessagingRuntimeHostedService.cs | Removes redundant null-check before disposing the hosted runtime. |
| src/HotChocolate/Utilities/src/Utilities.Buffers/ChunkedArrayWriter.cs | Adds suppression around chunk null-check in drain/cleanup loop. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Transport/Http/FileEntryBuilder.cs | Simplifies path handling by removing redundant parent null checks. |
| src/HotChocolate/Data/src/Data/Projections/Expressions/Handlers/QueryableProjectionScalarHandler.cs | Adds suppression for nullable-flow loop condition during expression unwrapping. |
| src/HotChocolate/Core/test/Types.Tests/Types/Relay/NodeTypeTests.cs | Simplifies “no errors” assertion assuming Errors is non-null. |
| src/HotChocolate/Core/test/Types.Tests/Types/Relay/NodeResolverTests.cs | Simplifies “no errors” assertion assuming Errors is non-null. |
| src/HotChocolate/Core/test/Types.Tests/Types/ObjectTypeTests.cs | Adds suppression for context non-null check in async resolver test helper. |
| src/HotChocolate/Core/test/Types.CursorPagination.Tests/UseConnectionAttributeTests.cs | Simplifies “no errors” assertion assuming Errors is non-null. |
| src/HotChocolate/Core/src/Types/Execution/Pipeline/OperationExecutionMiddleware.cs | Removes query root null-guard and resolves query root directly from schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9517 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes (Less than 80 chars)