In SelectionSet::remove_conditions_from_selection_set, a SelectionMap was being constructed directly from an existing selection set. Each selection had its conditions removed and inserted into the new map; however, it is possible that removing the directives from the selection would now cause a key collision. An example of this can be seen in the tests that were added:
query Test($b: Boolean!) {
foo @include(if: $b) {
bar {
name
}
bar @include(if: $b) {
thing
}
}
}
When the selection set was finalized, the selection bar { name } was getting overwritten because, after the next selection had its @include directive removed, the two selections' keys collided. In the JS code, they used SelectionSet::lazyMap, so now the Rust code does too.
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
[ ] Changes are compatible[^1]
[ ] Documentation[^2] completed
[ ] Performance impact assessed and acceptable
Tests added and passing[^3]
[ ] Unit Tests
[x] Integration Tests
[ ] Manual Tests
Exceptions
Note any exceptions here
Notes
[^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.
[^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples.
[^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.
[ ] events - Stress test for events with a lot of users and deduplication ENABLED
[ ] events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
[ ] events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
[ ] events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
[ ] events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
[ ] events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
In SelectionSet::remove_conditions_from_selection_set, a
SelectionMap
was being constructed directly from an existing selection set. Each selection had its conditions removed and inserted into the new map; however, it is possible that removing the directives from the selection would now cause a key collision. An example of this can be seen in the tests that were added:When the selection set was finalized, the selection
bar { name }
was getting overwritten because, after the next selection had its@include
directive removed, the two selections' keys collided. In the JS code, they usedSelectionSet::lazyMap
, so now the Rust code does too.Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
[^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.