Skip to content

Conversation

Copy link

Copilot AI commented Dec 19, 2025

The HTTP Multipart Transport was silently skipping nested multipart parts instead of treating them as protocol violations.

Changes

  • gql/transport/http_multipart_transport.py: Replace continue with TransportProtocolError when isinstance(part, aiohttp.MultipartReader) is true
  • tests/test_http_multipart_transport.py: Add test coverage for nested multipart error case

Behavior

# Before: nested multipart parts were silently ignored
if isinstance(part, aiohttp.MultipartReader):
    continue

# After: protocol violation raises immediately
if isinstance(part, aiohttp.MultipartReader):
    raise TransportProtocolError(
        "Received unexpected nested multipart part in GraphQL subscription response."
    )

Nested multipart is not part of the GraphQL subscription protocol spec. Raising an error makes protocol violations explicit rather than masking potential server misconfigurations.

Original prompt

On http_multipart_transport.py:231-231, actually this should throw an error

if isinstance(part, aiohttp.MultipartReader):
raise TransportProtocolError(
"Received unexpected nested multipart part in GraphQL subscription response."
)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix nested multipart error in GraphQL subscription Raise error on nested multipart parts in HTTP subscription responses Dec 19, 2025
Copilot AI requested a review from magicmark December 19, 2025 23:19
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.

2 participants