fix(federation): keep condition exclusions duplicate-free so equality and cache lookups are set-based - #10367
Open
inanna-apollo wants to merge 1 commit into
Open
inanna-apollo wants to merge 1 commit into
inanna-apollo wants to merge 1 commit into
Conversation
Contributor
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 1 changed, 0 removedBuild ID: 688cdc0ac113668888bdddd6 URL: https://www.apollographql.com/docs/deploy-preview/688cdc0ac113668888bdddd6 ✅ AI Style Review — No Changes DetectedNo MDX files were changed in this pull request. Review Log: View detailed log
|
This comment has been minimized.
This comment has been minimized.
inanna-apollo
force-pushed
the
inanna/fix-19-excluded-conditions
branch
from
October 5, 2026 18:04
f2febb6 to
c99ee54
Compare
inanna-apollo
marked this pull request as ready for review
October 5, 2026 18:04
… and cache lookups are set-based `ExcludedConditions` is compared as a set (equal length plus one-way membership), but `add_item` appended unconditionally. Once a condition was added twice, equality stopped being symmetric ([A, A] == [A, B] but not the reverse), and `ConditionResolverCache::contains` could return a resolution cached under [A, A] for a request excluding [A, B]. Make `add_item` a no-op when the condition is already excluded, matching `ExcludedDestinations::add_excluded`. The length+containment equality is then a correct set equality, so the cache key is independent of how a set of exclusions was built. Current planner and composition call sites already skip edges whose condition is excluded before adding it, so plans do not change.
inanna-apollo
force-pushed
the
inanna/fix-19-excluded-conditions
branch
3 times, most recently
from
October 5, 2026 18:24
c99ee54 to
1807844
Compare
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.
ExcludedConditionsis compared as a set (equal length plus one-way membership), butadd_itemappended unconditionally. Once a condition was added twice, equality stopped being symmetric ([A, A] == [A, B] but not the reverse), andConditionResolverCache::containscould return a resolution cached under [A, A] for a request excluding [A, B].Make
add_itema no-op when the condition is already excluded, matchingExcludedDestinations::add_excluded. The length+containment equality is then a correct set equality, so the cache key is independent of how a set of exclusions was built. Current planner and composition call sites already skip edges whose condition is excluded before adding it, so plans do not change.Reachability
Not reachable from current planner paths: every call site skips edges whose condition is already excluded before adding it (a temporary duplicate-add panic never fired across the full lib and
--test mainsuites). This makes the data structure's equality and the condition cache correct by construction; plans do not change.Testing
The regression test(s) in this PR fail on
devand pass with this change; neighboring test suites pass with no snapshot changes. Found during property-based testing ofapollo-federation.Checklist