client: EncodingBody pairs its error mirror with construction only by convention
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start in connectrpc/src/client/mod.rs at call_client_stream, then locate the EncodingBody construction and its shared error slot. Verify how the slot is drained and how encoding failures reach the caller; done means the pairing is compiler-visible and the existing precise error behavior remains intact.
Written by the indexing model from the issue text.
Description
Problem
EncodingBody reports an encode failure two ways at once: it returns Poll::Ready(Some(Err(..))) through the body (which aborts the request at the transport level) and it stashes the error in a shared Arc<Mutex<Option<ConnectError>>> so the call can surface the precise error instead of the generic transport failure it would otherwise see.
Those two halves are paired by convention only. Nothing makes a construction site drain the mirror — the type system is happy with an EncodingBody whose error slot no caller ever reads, and the symptom would be a confusing unavailable transport error in place of the real encode failure, which is exactly the outcome the slot exists to prevent.
There is one construction site today (call_client_stream in connectrpc/src/client/mod.rs), and it does drain the slot, so this is latent rather than live.
Suggested fix
Make the contract compiler-visible, e.g.:
impl<S> EncodingBody<S> {
fn new(/* ... */) -> (Self, EncodeErrorSlot) { /* ... */ }
}
with #[must_use] on the returned slot, so a construction site that ignores it warns.
Why this is not in #227
Raised by @lovesegfault as a non-blocking comment on #227. The rest of that review round was documentation, which could be applied without disturbing an already-verified PR; this one is a refactor of the error path and would mean re-running the full battery. Splitting it out keeps that PR's verification intact.
Worth doing before a second construction site appears — that is the point at which the convention starts actually costing something.
- Dominant language
- Rust
- Stars
- 544
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
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/connect-rust
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
connectrpc/connect-rust#360 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
connectrpc/connect-rust#358 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 53/100
connectrpc/connect-rust#355 ·
-
Streaming request body errors are always reported as `internal`Possibly taken @AhmedElBanna80 claimed this 18 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
connectrpc/connect-rust#352 ·
-
Difficulty 3/5 Half a day Newbie friendliness 48/100
connectrpc/connect-rust#349 ·
All issues in connectrpc/connect-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Choochmeque/tauri-plugin-webdriver#134 ·
Maintainers usually reply within 17 days
-
bug rust SDK & CLI & REST API
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
boxlite-ai/boxlite#3292 ·
Maintainers usually reply within 1 day
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day