Skip to content

Fix gRPC empty compressed response handling#10090

Draft
Copilot wants to merge 2 commits into
developfrom
copilot/fix-grpc-empty-array-response
Draft

Fix gRPC empty compressed response handling#10090
Copilot wants to merge 2 commits into
developfrom
copilot/fix-grpc-empty-array-response

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

gRPC responses containing empty repeated fields could trigger a main-process zlib error (unexpected end of file) when the response frame was marked compressed but had a zero-length payload. This prevented Insomnia from displaying valid responses such as { "article_ids": [] }.

  • gRPC decompression

    • Patch @grpc/grpc-js compression handling to treat compressed zero-length message payloads as valid empty buffers.
    • Apply the same handling for gzip and deflate paths.
    • Preserve normal decompression errors for malformed non-empty payloads.
  • Regression coverage

    • Add coverage for receiving a compressed empty gRPC message frame without throwing.
const frame = Buffer.alloc(5);
frame.writeUInt8(1, 0);      // compressed
frame.writeUInt32BE(0, 1);   // zero-length payload

await expect(filter.receiveMessage(Promise.resolve(frame)))
  .resolves.toEqual(Buffer.alloc(0));

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix gRPC response with empty array returns error Fix gRPC empty compressed response handling Jun 16, 2026
Copilot AI requested a review from CurryYangxx June 16, 2026 09:56
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.

3 participants