fix: correct folder bundle upload progress % exceeding 100%#980
Open
theequationagency-dev wants to merge 1 commit into
Open
fix: correct folder bundle upload progress % exceeding 100%#980theequationagency-dev wants to merge 1 commit into
theequationagency-dev wants to merge 1 commit into
Conversation
Prefer file.progress.bytesTotal (set by TUS after CAR preprocessing) over file.size for virtual folder bundles, so numerator and denominator are in the same units (CAR bytes). Falls back to file.size before TUS has set bytesTotal. Fixes LumeWeb#521
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
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.
Prefer file.progress.bytesTotal (set by TUS after CAR preprocessing) over file.size for virtual folder bundles, so numerator and denominator are in the same units (CAR bytes). Falls back to file.size before TUS has set
only the 3-line block inside the if (meta?.isVirtualBundle && meta?.displayAsFolder) branch was modified, replacing file.size as the denominator with file.progress.bytesTotal || file.size to match units with bytesUploaded.
Fixes #521
Fix: Folder bundle upload progress percentage exceeding 100%
This PR fixes a bug where the upload progress percentage for folder bundles could exceed 100%.
Root Cause: When calculating progress for folder bundles,
uploadedByteswas tracked using Uppy's built-infile.progress.bytesUploaded, buttotalByteswas calculated usingfile.size. Since these values can differ (withbytesTotalpotentially being smaller thanfile.size), the uploaded bytes could exceed the reported total, causing progress to go over 100%.Fix: Changed
totalBytesto preferfile.progress.bytesTotaloverfile.size, falling back tofile.sizeonly whenbytesTotalis unavailable. This ensures both the numerator (bytesUploaded) and denominator (bytesTotal) come from the same tracking source, keeping the progress calculation consistent and within the 0–100% range.