deterministic SourceLocation serialization#3987
Merged
dondonz merged 2 commits intographql-java:masterfrom May 25, 2025
Merged
Conversation
Member
|
Agree ... this was an oversight and we will change it back |
andimarek
approved these changes
May 24, 2025
| return null; | ||
| } | ||
| return Map.of("line", line, "column", column); | ||
| LinkedHashMap<String, Object> map = new LinkedHashMap<>(2); |
Member
There was a problem hiding this comment.
Don't we have a Util method for that? Maybe not, but we should have that emulates the Map.of ...
andimarek
reviewed
May 24, 2025
| } | ||
| } | ||
|
|
||
| @RepeatUntilFailure(maxAttempts = 1_000) |
Member
There was a problem hiding this comment.
Oh ... never knew that annotation ... learned that something new here
Member
|
Thanks for the PR! |
dondonz
approved these changes
May 25, 2025
Member
|
Hey @jbellenger ... We backported this to 24.1 which is available now. |
Contributor
Author
|
Thanks! |
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.
In upgrading from 22.3 to 24.0, some of our tests that make assertions on serialized responses started failing.
I think this was probably caused by #3753, which changed the serialized representation from a LinkedHashMap to a
Map.of, which has randomized iteration order. This PR brings back the LinkedHashMap serialization format.I'd appreciate some feedback on this! While the spec doesn't describe how the fields of an error should be ordered, non-deterministic ordering can make it difficult to build reliable tests that interact with GraphQL errors.