Skip to content

Preserve underlying body read errors - #18

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
fix-body-read-errors
Sep 24, 2026
Merged

samuel-williams-shopify merged 1 commit into
mainfrom
fix-body-read-errors

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

A failed HTTP body can report empty? while its next read raises the pending error. The gRPC reader skipped that read, hiding failures as EOF or replacing them with misleading truncated-frame errors. Read until nil instead and propagate the original exception unchanged, while preserving clean EOF and truncated-frame handling.

Add regression coverage for failed empty bodies, partial prefixes, missing/partial payloads, and failures while finishing after a complete message. All five error regressions fail before the fix.

This supplies the shared reader fix needed to remove the ResponseBody workaround in async-grpc-compatible#9.

Validation on Ruby 4.0.7:

  • Protocol suite: 233 tests, 464 assertions; 100% line coverage.
  • External async-grpc suite: 84 tests, 201 assertions.
  • async-grpc-compatible PR Move header helpers to metadata #9 with this reader and its ResponseBody workaround removed: 122 tests, 436 assertions.
  • RuboCop and documentation coverage pass.

@samuel-williams-shopify
samuel-williams-shopify merged commit 6224ae3 into main Sep 24, 2026
40 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the fix-body-read-errors branch September 24, 2026 22:17
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.

1 participant