Skip to content

Fix typos - #38487

Merged
AndriySvyryd merged 3 commits into
mainfrom
Cleanup
Jun 25, 2026
Merged

Fix typos#38487
AndriySvyryd merged 3 commits into
mainfrom
Cleanup

Conversation

@AndriySvyryd

Copy link
Copy Markdown
Member

Systematic review of the codebase surfaced a set of latent bugs and inconsistencies that could only have been introduced by imperfect sentient beings.

Summary of fixes

  • Expression equality/quoting (High): Fixed RowNumberExpression.Quote() (wrong/missing constructor args broke precompiled ROW_NUMBER queries), JsonScalarExpression.Equals (missing base.Equals, breaking the Equals/GetHashCode contract), and SqlServerOpenJsonExpression.Equals (inverted SequenceEqual on column paths).
  • Sync/async consistency: ValueGenerationManager.PropagateAsync now applies the same !IsUnknown guard as the sync path when propagating FK values.
  • Operator precedence: Added missing parentheses in the InMemory translator's type-comparison and value-comparer logic (InMemoryExpressionTranslatingExpressionVisitor).
  • Off-by-one / bounds guards: CandidateNamingService.StripId no longer returns an empty navigation name for prefixes like _Id; MigrationsBundleCommand guards against IndexOfAny returning -1.
  • Diagnostics: AffectedCountModificationCommandBatch reports the actual rows-affected count (not a hardcoded 0) in stored-procedure concurrency exceptions.
  • Async hygiene: SqliteHistoryRepository retry delay now uses ConfigureAwait(false).
  • Consistency: Cosmos SessionTokenStorage uses ArgumentException.ThrowIfNullOrWhiteSpace consistently.
  • Micro-optimization: ReplacingExpressionVisitor uses ReferenceEquals instead of Equals.
  • Typos: Corrected 5 XML-doc/comment typos (the<see, occured, wheter, overriden).
  • Tests: Added unit regression tests for the equality-contract and scaffolding-naming fixes.

Copilot AI review requested due to automatic review settings June 24, 2026 16:44
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner June 24, 2026 16:44

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 a collection of correctness bugs and inconsistencies across EF Core query/update/scaffolding infrastructure (plus some doc/comment typos), with new regression coverage for a scaffolding edge-case.

Changes:

  • Fixes multiple expression-tree equality/quoting issues (e.g., ROW_NUMBER() quoting, JSON/OpenJson equality semantics).
  • Aligns sync/async behavior and async hygiene (FK propagation guard parity, ConfigureAwait(false) usage).
  • Fixes several small correctness issues (operator precedence, off-by-one/bounds guards, rows-affected diagnostics).

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/EFCore.Design.Tests/Scaffolding/Internal/CandidateNamingServiceTest.cs Adds regression coverage for scaffolding navigation naming when stripping Id would otherwise yield an empty name.
src/EFCore/Query/ReplacingExpressionVisitor.cs Micro-optimization: uses ReferenceEquals for replacement matching.
src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs Clarifies rationale for skipping SequenceEqual conversion.
src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs Aligns async FK propagation guard with sync (!IsUnknown).
src/EFCore.SqlServer/Storage/Internal/SqlServerTransientExceptionDetector.cs Comment typo fix (“occurred”).
src/EFCore.SqlServer/Query/Internal/SqlExpressions/SqlServerOpenJsonExpression.cs Fixes child visitation copy loop and corrects/integrates equality/hash behavior.
src/EFCore.SqlServer.Abstractions/HierarchyId.cs XML doc spacing typo fix.
src/EFCore.Sqlite.Core/Query/Internal/SqlExpressions/JsonEachExpression.cs Fixes child visitation copy loop (index increment bug).
src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs Adjusts async retry delay await configuration.
src/EFCore.Relational/Update/AffectedCountModificationCommandBatch.cs Improves stored-procedure concurrency exception to report actual affected rows.
src/EFCore.Relational/Query/SqlExpressions/RowNumberExpression.cs Fixes quoting constructor args to include partitions and correct ordering element type.
src/EFCore.Relational/Query/SqlExpressions/JsonScalarExpression.cs Fixes equality contract by including base.Equals.
src/EFCore.Relational/Metadata/IReadOnlyRelationalPropertyOverrides.cs Comment typo fix (“overridden”).
src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs Fixes precedence bugs via added parentheses.
src/EFCore.Design/Scaffolding/Internal/CandidateNamingService.cs Prevents StripId from returning empty strings for prefixes like _Id.
src/EFCore.Design/Query/Internal/PrecompiledQueryCodeGenerator.cs Comment typo fix (“occurred”).
src/EFCore.Design/Extensions/ScaffoldingModelExtensions.cs Comment typo fix (“whether”).
src/EFCore.Cosmos/Storage/Internal/SessionTokenStorage.cs Uses ArgumentException.ThrowIfNullOrWhiteSpace consistently for whitespace checks.
src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs Simplifies warning condition for row-limiting ops without ordering.
src/ef/Commands/MigrationsBundleCommand.cs Guards against IndexOfAny returning -1 when slicing runtime identifiers.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

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

Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.

Simplified GetHashCode method to only include ColumnInfos count.
Copilot AI review requested due to automatic review settings June 24, 2026 19:27

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

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

@AndriySvyryd
AndriySvyryd merged commit 0ec4c6c into main Jun 25, 2026
14 checks passed
@AndriySvyryd
AndriySvyryd deleted the Cleanup branch June 25, 2026 17:45
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants