Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Addresses potential division by zero when calculating transfer speed in progress tracking callbacks. When operations complete in <1ms, elapsedSeconds can be 0, resulting in Infinity for speedMBps.

Changes:

  • Added guard in zip.ts and upload.ts to return 0 when elapsedSeconds < 0.001
  • Prevents "Infinity MB/s" from appearing in progress output during initial callback invocations
// Before
speedMBps: written / elapsedSeconds / 1024 / 1024

// After  
const speedMBps = elapsedSeconds < 0.001 ? 0 : written / elapsedSeconds / 1024 / 1024

Speed displays as "0.00 MB/s" initially, then updates to actual rate as data transfers.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on progress tracking logic Guard against division by zero in progress speed calculation Jan 22, 2026
Copilot AI requested a review from madebydavid January 22, 2026 11:56
@madebydavid madebydavid marked this pull request as ready for review January 22, 2026 11:57
@madebydavid madebydavid merged commit d084d52 into 138-feature-some-progress-indication-of-the-upload-progress-in-default-ship-mode-and-follow-ship-mode Jan 22, 2026
@madebydavid madebydavid deleted the copilot/sub-pr-139-again branch January 22, 2026 11:58
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.

2 participants