Repository navigation
Conversation
…wasm-client The response body can now be fed from in-memory chunks, so the tests run natively, without a browser: `ResponseBody::new` delegates to a private `from_body_stream` (no change in behaviour), and a `cfg(test)` `BodyStream::from_chunks` builds the stream. Eight of the tests fail on this commit: the trailer frame is parsed but never handed to tonic, so a status sent in the body trailer is lost. Co-Authored-By: Claude <noreply@anthropic.com>
tonic-web-wasm-client 0.8.0 parsed the trailer frame, stored it in a field nothing read, and ended the body as soon as it saw the trailer flag. tonic never got the trailers, and with HTTP 200 and no trailers it reports success, so a status sent in the body trailer (an error after some messages, or after a unary message) was lost. The body now yields the parsed trailers as a trailers frame, once, after the last data frame. It only counts as finished once the trailer frame has been read in full, so a trailer split across chunks is read and a stream that ends inside the trailer frame is MalformedResponse instead of a clean end. The first part is the response_body.rs change of upstream 0f232d33 (devashishdxt/tonic-web-wasm-client#90, released in 0.9.1). Co-Authored-By: Claude <noreply@anthropic.com>
…ob for the vendored tests trailers.patch applies on top of trailers-only.patch and reproduces src/ from crates.io 0.8.0, apart from the test files: it carries their two cfg(test) hooks but not src/response_body/. The vendored crate is excluded from the workspace, so a separate job runs its tests against the workspace lock. Co-Authored-By: Claude <noreply@anthropic.com>
Their browser OHTTP proof had already fixed it in its own patch, not only found it. Co-Authored-By: Claude <noreply@anthropic.com>
They found the lost trailer status, reproduced it and fixed it first in their browser OHTTP proof (https://github.com/Crackdevs/zcash-browser-ohttp-proof). Co-authored-by: Crackdevs <info@crackdevs.org> Co-Authored-By: Claude <noreply@anthropic.com>
Crackdevs
marked this pull request as draft
November 17, 2026 16:05
danielgorgonha
approved these changes
Nov 17, 2026
danielgorgonha
left a comment
There was a problem hiding this comment.
At b0fd000 the vendored crate's 25 native tests pass, and the six new regressions fail when src/response_body.rs is put back to #28 (a189141) with the new tests kept. Approving.
- EOF wait. After the trailer parses, the body waits on the stream's own waker and forwards the trailer only at a clean end. There is no busy loop, a transport error while waiting reaches tonic with the trailer dropped, and dropping the stream drops the source. Data frames are yielded one per poll and taken before the next step, so none is overwritten.
- Status validation. Each new check is covered. Removing any one of them (duplicate, missing, non-digit, leading zero, the blank-line guard, bytes after the trailer) makes a test fail. Since
HeaderName::from_byteslowercases,Grpc-Statuscounts as a duplicate. Only0reaches tonic as OK, and other numbers reach it asUnknownwith message, details and metadata intact, as agreed in Crackdevs/zcash-browser-ohttp-proof#1. - The three patches applied in order to the crates.io 0.8.0 source, plus
src/response_body/, give the vendoredsrc/exactly. - Non-blocking, a note for VENDORED.md. A server that keeps the body open after the trailer now holds the call, where #28 completed it. WebZjs builds its client with
Client::new(crates/webzjs-wallet/src/bindgen/wallet.rs:144) and sets no timeout, so for WebZjs wallets "the existing fetch cancellation and deadline behavior" means no deadline. The public endpoint we measured (zcash-mainnet.chainsafe.dev) closes the body within 0.3 ms of the trailer, so this is unlikely to bite, but it is worth one sentence there. - The
raw_bufchecks are not reachable yet, because the text path panics indecode_base64_chunkbefore them, on #28 as well. That matches the limitation VENDORED.md already lists, and the checks are right once that path is fixed.
This review was prepared with an AI assistant, which also ran the tests. I read it before posting.
Author
|
Thanks, @danielgorgonha, for reviewing this and reproducing the tests. we've added the clarification in VENDORED.md that WebZjs currently sets no request timeout, so waiting for EOF can leave a call pending. The existing text/base64 limitation remains documented and outside this follow-up. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #28 and our discussion with Daniel/Konclave.
This PR depends on #28. While #28 remains unmerged, the full comparison includes its changes. Our incremental follow-up is:
Crackdevs@b0fd000
Changes
Existing HTTP-header status precedence and duplicate handling for other metadata remain outside this change. The OHTTP transport hook is tracked separately in #30.
Validation
Recorded local validation:
Cancellation coverage includes browser timeout cancellation and native stream-drop cancellation.
The standalone WASM crate and harness build passed using dependency versions from the workspace lock. Building the vendored crate through the workspace’s plain WASM command encountered the same native Tokio/mio target failure on both the baseline and patched versions.
The public endpoint measurements were separate from the compiled Rust/WASM tests against controlled fixtures.
These results come from the original local validation. The published files match the reviewed patch; the tests were not rerun in Codespaces.
Review
@danielgorgonha, this is the follow-up we discussed. Please review the EOF handling and body-trailer status validation.
Thanks to Daniel/Konclave for the #28 backport, regression tests and public endpoint measurements. Attribution to the original Crackdevs proof and upstream changes is retained in VENDORED.md.
Review evidence
Test results, logs and reproduction instructions:
https://github.com/Crackdevs/zcash-browser-ohttp-proof/blob/main/webzjs-trailer-follow-up/README.md