feature: adding progress tracking when zipping and when uploading#139
Conversation
There was a problem hiding this comment.
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.tsandupload.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.
|
@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. |
|
@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>
|
@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>
|
@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. |
|
@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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Guard against division by zero in progress speed calculation
|
@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. |
|
@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. |
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
|
I will do some final testing with the updates |
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
onUploadProgress- see onUploadProgress will be 100% before uploading process finished axios/axios#3469 )Transformto trigger anonProgresswith each "chunk"onProgressto only be called every 2 secondscreateZipanduploadZipin new util modules - these trigger an onProgress with data related to the progressNote
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
--followfor a large game138-follow-ship.webm