Repository navigation
fix(odata): handle mixed annotation cache key collisions - #909
Merged
Gavin Barron (gavinbarron) merged 1 commit intoOct 13, 2026
Merged
Gavin Barron (gavinbarron) merged 1 commit into
Gavin Barron (gavinbarron) merged 1 commit into
Conversation
Compare EdmTargetPath keys by ordinal path value without calling their unsafe cross-type Equals override. Preserve default nonpath equality and hashing, cache locking and model invalidation. Add deterministic mixed-key collision and cache semantics regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 278c98ec-426d-4542-9536-6fa5bf6a821f
|
Gavin Barron (gavinbarron)
enabled auto-merge (squash)
October 13, 2026 20:56
Ramses Sanchez-Hernandez (ramsessanchez)
approved these changes
Oct 13, 2026
Gavin Barron (gavinbarron)
deleted the
gavinbarron-odata-annotation-cache-collision
branch
October 13, 2026 21:47
Gavin Barron (gavinbarron)
added a commit
that referenced
this pull request
Oct 13, 2026
Port the private annotation target comparer and seven regression cases from #909. Preserve ordinal path comparison and default nonpath equality without changing cache locking or model invalidation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c249d37-7577-48ae-9e5c-07451849bc7d
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
Fix the heterogeneous annotation cache in
GetOrAddCachedwithout changing annotation readers, locking, model invalidation, dependencies or publishing configuration.EdmTargetPathkeys by ordinalPathvalue and use matching ordinal hashes.EdmTargetPath.Equalscall when hashes collide.EqualityComparer<IEdmVocabularyAnnotatable>.Defaultequality and hashing for nonpath keys.Addresses the genuine main CI failure at
ec43631ab6c2502a24b9fd25c5b354228ef803bb: run 38455900148, where Graph path generation and link generation failed inEdmTargetPath.Equals→Dictionary.FindValue→GetOrAddCached.Validation
Before the production fix, both forced-collision cases reproduced that exact
NullReferenceExceptionstack; the other 10 annotation cases passed. After the fix:ODataPathProviderTests.GetPathsForGraphBetaModelReturnsAllPathsandOpenApiLinkGeneratorTests.CreateLinksForEntitiestests.OData was run with its project-specific
dotnet testrunner; Hidi separately withdotnet run --project .\test\Microsoft.OpenApi.Hidi.Tests\Microsoft.OpenApi.Hidi.Tests.csproj -c Release --no-restore -- --minimum-expected-tests 1. No mixed-runner solution command.Scope
Two files only; no pipeline, assertion-count, dependency, version, tag or release changes. This is a fresh branch from main, not the closed publishing branch.
Read-only review of
support/v2at92e4df6cf3c4deb53c3b4a1d1c45fe2320adaaa1confirms the same default heterogeneous cache and the same unsafeEdmTargetPath.Equalsimplementation in its Microsoft.OData.Edm 8.3.0 dependency. v2 is also affected, but remains unchanged and requires a separate correction.