Test that implementations reject a stream body cut off partway through a message
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- go, grpc
- Domain
- api, testing-qa
Research direction
Start with the existing raw request and response support in the Connect, gRPC, and gRPC-Web suites, then review the incomplete-message and incomplete-message-prefix cases described in the issue. Add the four truncation cases for each applicable direction and the Connect data-after-end-stream case, then run the suites and verify the expected invalid-argument or internal codes and the grpcclient-known-failing.txt, grpcserver-known-failing.txt, and grpcserver-web-known-failing.txt results.
Written by the indexing model from the issue text.
Description
The Connect, gRPC, and gRPC-Web unexpected request and response suites cover messages with bad flags, codecs, and compression, and #1104 added a response that ends without the Connect end-stream message. No case covers a body that ends partway through an enveloped message, in either direction, or a Connect response with data after its end-stream message. An implementation that stops reading at the end of the body and drops its partial buffer reports these as complete streams, which is indistinguishable from success. connect-py did this for both requests and responses (connectrpc/connect-py#359), and the current suites pass either way.
I have the cases below on a branch: https://github.com/connectrpc/conformance/compare/main...stefanvanburen:conformance:svanburen/incomplete-request-body
Cases
Each direction gets two cases, built with the existing raw request and response support:
incomplete-message: a stream item whose prefix promises 10 bytes and whose payload is 3 bytes, usingStreamItem.length.incomplete-message-prefix: a raw body that ends 3 bytes into a 5-byte prefix.
Server suites (Connect, gRPC, gRPC-Web) send these as a ClientStream request. Client suites (Connect, gRPC) send them as a ServerStream response after one complete message. gRPC-Web clients are left out, since a gRPC-Web body cut off mid-message also has no trailers frame, which trailers-in-body/missing-status already covers. The Connect client suite also gets server-stream/data-after-end-stream: a message, the end-stream message, then another message.
Expected codes
The truncation cases expect CODE_INVALID_ARGUMENT, and data-after-end-stream expects CODE_INTERNAL, which is what connect-go returns ("protocol error: promised N bytes in enveloped message, got M bytes", "protocol error: incomplete envelope: unexpected EOF", and "corrupt response: N extra bytes after end of stream"). For gRPC and gRPC-Web, CODE_INTERNAL is also allowed, since the gRPC spec doesn't name a code and grpc-go uses internal.
Results on the branch
- Reference server: 24 of 24 variants pass. Reference client: 19 of 19 pass.
- grpc-go, client and server:
incomplete-messagepasses withinternal.incomplete-message-prefixfails: grpc-go treats a body that ends mid-prefix as complete and reports success. The branch lists those cases ingrpcclient-known-failing.txt,grpcserver-known-failing.txt, andgrpcserver-web-known-failing.txt.
Happy to open a PR from the branch if this looks right.
- Dominant language
- Go
- Stars
- 96
- Forks
- 22
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from connectrpc/conformance
-
Reformat test names for single-protocol tests to start with Protocol/, i.e. gRPC/ or Websocket/Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
connectrpc/conformance#1211 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
connectrpc/conformance#1120 ·
Maintainers usually reply within 1 day
-
Test that clients reject malformed response messagesPossibly taken @stefanvanburen claimed this 23 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
connectrpc/conformance#1190 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
connectrpc/conformance#1146 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
connectrpc/conformance#1143 · 1 comment ·
Maintainers usually reply within 1 day
All issues in connectrpc/conformance
Similar issues
-
BasicEventElement `messageBroker` is never returned on read (jsonb decoded into `sql.NullString`)Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
eclipse-basyx/basyx-go-components#963 ·
Maintainers usually reply within 1 day
-
Area/Console Aspect/UI Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
wso2/agent-manager#2743 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day