Skip to content

Conversation

@madebydavid
Copy link
Member

@madebydavid madebydavid commented Jan 21, 2026

Background

This is to resolve #138 where we have been testing with a very large game and need some indication of what shipthis is doing. The issue mentions tracking the upload progress but whilst testing I found that zipping was taking a long time too and so implemented progress indication for that too.

What's changed

  • Replaced the axios based zip upload with a fetch based one (because of issues with axiosonUploadProgress - see onUploadProgress will be 100% before uploading process finished axios/axios#3469 )
  • Implemented a "progress stream" which uses Transform to trigger an onProgress with each "chunk"
  • Throttled onProgress to only be called every 2 seconds
  • Implemented createZip and uploadZip in new util modules - these trigger an onProgress with data related to the progress
  • Outputting zip progress and upload progress to console.log

Note

When calculating the zip progress %age - we have to estimate what the final size will be and use this to get a rough value for the progress %age. This is a limitation.

Demo

Default ship output with a large game

138-default-ship.webm

Ship with --follow for a large game

138-follow-ship.webm

@madebydavid madebydavid marked this pull request as ready for review January 22, 2026 11:08
@madebydavid madebydavid requested a review from Copilot January 22, 2026 11:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds progress tracking for both zipping and uploading operations to address issue #138, providing visual feedback during long-running operations with large games.

Changes:

  • Replaced axios-based upload with fetch-based implementation to properly support upload progress tracking
  • Created new utility modules (zip.ts and upload.ts) with progress tracking capabilities using Node.js Transform streams
  • Integrated progress tracking into the ship workflow with throttled console output every 2 seconds

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.

File Description
src/utils/zip.ts New utility module providing zip creation with progress tracking, using estimated compression ratios for progress calculation
src/utils/upload.ts New utility module providing streaming upload with progress tracking and reusable progress stream transform
src/utils/query/useShip.ts Refactored to use new zip and upload utilities, replaced inline zip creation with createZip and axios upload with uploadZip, added progress logging
src/utils/index.ts Added exports for new zip and upload utility modules

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

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #140, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #141, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #142, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #143, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #144, to work on those changes. Once the pull request is ready, I'll request review from you.

madebydavid and others added 3 commits January 22, 2026 11:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Guard against division by zero in progress speed calculation
Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #145, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@madebydavid I've opened a new pull request, #146, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 5 commits January 22, 2026 12:05
Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Add documentation for duplex property in streaming upload
Fix incomplete error handling in createZip stream pipeline
@madebydavid
Copy link
Member Author

I will do some final testing with the updates

@madebydavid madebydavid merged commit a3c9466 into main Jan 22, 2026
@madebydavid madebydavid deleted the 138-feature-some-progress-indication-of-the-upload-progress-in-default-ship-mode-and-follow-ship-mode branch January 22, 2026 12:18
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.

feature: some progress indication of the upload progress in default ship mode and follow ship mode

2 participants