feat(net): hyper leaf buffering (BufferMode::Buffer arm)#92
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Records PR B (BufferMode::Buffer arm, landed in 805437b) in the CHANGELOG, and refreshes the hyper leaf module doc which still said buffering was future work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the BufferMode::Buffer branch that collects the body inside call() itself, so a mid-body failure returns Err from call() (and not only from the later body-collect) — the property Retry depends on to re-drive the whole request. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe hyper backend’s ChangesBufferMode-driven Response Handling
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Around line 114-118: Replace the unresolved PR placeholder in the changelog
entry with the actual pull request number or link. Update the `CHANGELOG.md`
entry for the net-http hyper backend note so the `(#<PR-B>)` reference uses the
real PR identifier, keeping the rest of the `ResponseBody::buffered` description
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: da42b682-b6d6-4d46-a397-7904db2663ae
📒 Files selected for processing (2)
CHANGELOG.mdcrates/adapter/net/http/hyper/src/leaf.rs
Closes #91. Second and final PR of the hyper-backend slice (PR A was #90).
Adds the `BufferMode::Buffer` branch to `HyperLeaf::call`: when a request carries a `BufferMode::Buffer` extension, the leaf collects the `Incoming` response body into `Bytes` inside the retry boundary (mapping the collect error with the same `map_hyper_err` as the streaming arm) and returns `ResponseBody::buffered`. The default (no extension) and explicit `BufferMode::Stream` keep the PR A streaming arm unchanged.
Additive only — no change to `type Response`/`type Error`/`HyperBody`/`ConnConfig`/`hyper_leaf`/`build()` or any resilience layer.
Commits:
Tests: buffered request → `Buffered` arm carrying exact bytes; default + explicit `Stream` → `Streaming` arm; buffered mid-body failure surfaces as `Err(HttpError::Other)` from `call()` (proving retry coverage). `just ci` + `just msrv` green.
Design: docs/superpowers/specs/2026-07-05-net-http-hyper-backend-design.md
Plan: docs/superpowers/plans/2026-07-05-net-http-hyper-backend-pr-b.md
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
BufferModeto control response buffering.BufferMode::Bufferreceive an eagerly buffered response body; otherwise responses remain streamed.Bug Fixes