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

[GTLRService responsePartWithMIMEPart:] sets error for "204 No Content" responses #346

Closed
jgheab opened this issue Apr 29, 2020 · 3 comments · Fixed by #347
Closed

[GTLRService responsePartWithMIMEPart:] sets error for "204 No Content" responses #346

jgheab opened this issue Apr 29, 2020 · 3 comments · Fixed by #347

Comments

@jgheab
Copy link

jgheab commented Apr 29, 2020

Repro steps:

  1. Call [GTLRService responsePartWithMIMEPart:] passing a GTMMIMEDocumentPart instance where the body property is set to:

HTTP/1.1 204 No Content
ETag: ""
Date:
<CRLFCRLF (must end in "\r\n\r\n" with no additional data)>

Expected:
The returned GTLRBatchResponsePart instance should not have its parseError or JSON properties set, since no error occurred and no content was returned.

Actual:
parseError is set.
Domain: "com.google.GTLRServiceDomain" (kGTLRServiceErrorDomain).
Code: -3001 (GTLRServiceErrorBatchResponseUnexpected).

@thomasvl
Copy link
Member

thomasvl commented Apr 29, 2020

Can you provide some more details? Normally there are also headers on the mime part which would include a Content-ID, etc. It helps to know we're looking at the same setup.

Edit: Exactly where else there are CRLFs vs. just CR or LF could also come into play here.

@thomasvl
Copy link
Member

If my guess is correct, a little more about what is happening in this batch might help. I'm guessing you are making multiple request, and one part is succeeding, but with no new content (because of the ETag)? So this this likely isn't just about this parse being correct, but also ensuring everything else "works" in the case for the batch.

thomasvl added a commit to thomasvl/google-api-objectivec-client-for-rest that referenced this issue Apr 30, 2020
If a batch include a delete, this it might not have any data in the reply, that
was forcing an error, instead allow it succeed with non JSON, this should be
like the flows for single objects.

Fixes google#346
thomasvl added a commit to thomasvl/google-api-objectivec-client-for-rest that referenced this issue Apr 30, 2020
If one of the methods was a delete, it might not have any data in the reply,
that was forcing an error, instead allow it succeed with no JSON coming back,
this should be like the flows for single objects.

Fixes google#346
thomasvl added a commit to thomasvl/google-api-objectivec-client-for-rest that referenced this issue Apr 30, 2020
If one of the methods was a delete, it might not have any data in the reply,
that was forcing an error, instead allow it succeed with no JSON coming back,
this should be like the flows for single objects.

Fixes google#346
thomasvl added a commit to thomasvl/google-api-objectivec-client-for-rest that referenced this issue Apr 30, 2020
If one of the methods was a delete, it might not have any data in the reply,
that was forcing an error, instead allow it succeed with no JSON coming back,
this should be like the flows for single objects.

Fixes google#346
thomasvl added a commit that referenced this issue Apr 30, 2020
If one of the methods was a delete, it might not have any data in the reply,
that was forcing an error, instead allow it succeed with no JSON coming back,
this should be like the flows for single objects.

Fixes #346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants
@thomasvl @jgheab and others