Repository navigation
Show upload progress for the legacy upload command - #52
Merged
Merged
Conversation
`poki upload` printed "uploading..." and then nothing until the server answered, so a large build on a slow connection looked stuck. The body is now written in 64 KiB slices, and each write callback updates a progress line with the percentage, bytes sent, and transfer rate. The line is drawn only when stdout is a terminal. Piped, captured, and CI output is byte-identical to before, which keeps the compatibility guarantee for the legacy command. Content-Length, the body, and the inactivity timeout are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
erikdubbelboer
requested changes
Nov 27, 2026
The bar never shrank below 10 columns, so on a 40-column terminal the line reached 48 characters and wrapped, and each redraw left part of the previous one behind. Narrow terminals now drop the rate, then the byte counts, then the bar, and always keep the line shorter than the terminal. An interrupt exits without settling the request, so the error document continued the unfinished progress line. The line's finish is now an interrupt cleanup, unregistered once the request settles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
erikdubbelboer
approved these changes
Nov 27, 2026
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.
Summary
poki uploadused to printuploading...and then go quiet until the server answered, so a large build on a slow connection looked stuck. It now draws a live progress line:Content-Length, the request body and the inactivity timeout are unchanged. If the response arrives before the body has finished sending, the line still ends cleanly, so later output starts on a new row.poki versions uploadis unchanged. It sends throughfetchwith aFormDatabody, and showing progress there would mean streaming the body, which drops the knownContent-Length. That is a separate decision.Test plan
yarn validate(lint, typecheck, all tests, package check, build)test/upload-progress.test.ts: covers formatting, throttling, ending the line exactly once, and the non-TTY no-op. An end-to-endpostToP4Drun through a loopback server checks that the body andContent-Lengtharrive intact, and that the human text is unchanged in both TTY and non-TTY modes.poki uploadagainst production with a large build🤖 Generated with Claude Code