Skip to content

fix: upload body completion tracking - #44

Merged
HenriqueSFernandes merged 2 commits into
mainfrom
fix/42-mach-upload-body-finish
Jul 23, 2026
Merged

fix: upload body completion tracking#44
HenriqueSFernandes merged 2 commits into
mainfrom
fix/42-mach-upload-body-finish

Conversation

@HenriqueSFernandes

@HenriqueSFernandes HenriqueSFernandes commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

CountingBody relied on size_hint() to detect the final upload frame, but UploadBody does not provide a bounded size hint.

Use the wrapped body’s is_end_stream() state and guard final events so completion is reported exactly once.

Closes #42

Copilot AI review requested due to automatic review settings July 16, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes upload completion tracking in CountingBody by replacing a size_hint()-based “last frame” heuristic (which fails for bodies without bounded size hints, like UploadBody) with is_end_stream() checks on the wrapped body, ensuring completion events are emitted exactly once.

Changes:

  • Switch “last frame” detection from size_hint() to the wrapped body’s is_end_stream() state.
  • Ensure final ByteCount + Finished events are guarded by sent_finished in both the last-frame path and the Poll::Ready(None) path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HenriqueSFernandes
HenriqueSFernandes merged commit a8d8e50 into main Jul 23, 2026
3 checks passed
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.

mach upload fails with "body did not finish"

3 participants