Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding checks for json end_document in http transport #5895

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duzinkie
Copy link

the issue is discussed in: #5885

this is the recommended fix for the no http batching scenario, for the main branch

@apollo-cla
Copy link

@duzinkie: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link

netlify bot commented May 15, 2024

👷 Deploy request for apollo-android-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit baec9ca

@duzinkie duzinkie changed the title adding checks for json end_document in http batching interceptors adding checks for json end_document in http transport May 16, 2024
Comment on lines +48 to +50
if (jsonReader.peek() != JsonReader.Token.END_DOCUMENT) {
println("Apollo: extra tokens after payload")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things:

  1. Can you move this to the toApolloResponse() function? I'd like to keep the possibility to read a single JSON object from ResponseParser.parse in the future
  2. Let's make it an error? For this you can throw JsonDataException("Expected END_DOCUMENT but was ${peek()}")

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.

None yet

3 participants