Skip to content

MultipartResponseDeferParser in V2 fails to parse close delimiter in at least some cases #3612

@ecant

Description

@ecant

Summary

Apollo iOS v2.0.3's MultipartResponseDeferParser throws ParsingError.cannotParseChunkData when handling multipart GraphQL responses with @defer if the server sends the close delimiter (--graphql--\r\n) as a separate HTTP chunk.

This is a change from Apollo iOS v1, which handled this case with a check for chunk.isDashBoundaryPrefix in MultipartResponseParsingInterceptor.

Version

2.0.3

Steps to reproduce the behavior

  1. Use Apollo iOS SDK v2.0.3
  2. Execute a GraphQL query with @defer directive that returns a multipart response
  3. Server sends multipart response where the final close delimiter --graphql--\r\n arrives as its own separate chunk

Logs

/// Raw response from Proxyman with json payload redacted. 


HTTP/1.1 200 OK
Content-Type: multipart/mixed;boundary="graphql";deferSpec=20220824
Transfer-Encoding: chunked
Connection: keep-alive


--graphql
content-type: application/json

{"data":{},"hasNext":true}
--graphql
content-type: application/json

{"hasNext":false,"incremental":[]}
--graphql--

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugGenerally incorrect behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions