From 7f60e3d6284dfc4e3b9bd0c6d7bc50974a1ce2b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:51:56 +0000 Subject: [PATCH 1/2] Initial plan From f8cae3f84032c5176ff2de24a4696514f6eab470 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:54:41 +0000 Subject: [PATCH 2/2] Fix division by zero in speed calculation for zip and upload progress Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com> --- src/utils/upload.ts | 3 ++- src/utils/zip.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/upload.ts b/src/utils/upload.ts index 9924e9d..9540463 100644 --- a/src/utils/upload.ts +++ b/src/utils/upload.ts @@ -46,11 +46,12 @@ export function uploadZip({url, zipStream, zipSize, onProgress}: UploadProps): P const progressStream = createProgressStream(zipSize, (sent, total) => { const elapsedSeconds = (Date.now() - startTime) / 1000 + const speedMBps = elapsedSeconds < 0.001 ? 0 : sent / elapsedSeconds / 1024 / 1024 onProgress({ progress: total ? sent / total : 0, loadedBytes: sent, totalBytes: total, - speedMBps: sent / elapsedSeconds / 1024 / 1024, + speedMBps, elapsedSeconds, }) }, ON_PROGRESS_THROTTLE_MS) diff --git a/src/utils/zip.ts b/src/utils/zip.ts index 407f097..572e400 100644 --- a/src/utils/zip.ts +++ b/src/utils/zip.ts @@ -47,13 +47,14 @@ export async function createZip({files, outputPath, onProgress}: CreateZipProps) const progressStream = createProgressStream(estimatedZipSize, (written, total) => { const elapsedSeconds = (Date.now() - startTime) / 1000 + const speedMBps = elapsedSeconds < 0.001 ? 0 : written / elapsedSeconds / 1024 / 1024 onProgress({ progress: total ? Math.min(1, written / total) : 0, writtenBytes: written, estimatedTotalBytes: total, sourceTotalBytes: totalSourceSize, elapsedSeconds, - speedMBps: written / elapsedSeconds / 1024 / 1024, + speedMBps, }) }, ON_PROGRESS_THROTTLE_MS)