-
Notifications
You must be signed in to change notification settings - Fork 78
fix(FR-1501): fix file upload status tracking and error handling #4412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.65% (-0% 🔻) |
532/11435 |
| 🔴 | Branches | 3.75% (-0.01% 🔻) |
302/8044 |
| 🔴 | Functions | 2.88% (-0% 🔻) |
102/3545 |
| 🔴 | Lines | 4.6% (-0% 🔻) |
514/11174 |
Test suite run success
121 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from e5745cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes inaccurate and fragile file upload status tracking by restructuring status data and improving progress calculation and notifications.
- Introduces structured UploadStatus objects with vFolderNames and totalSize.
- Adds byte-based progress and concurrent uploads (PQueue concurrency 10).
- Adjusts FolderExplorer to new status shape.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| react/src/components/FolderExplorer.tsx | Updated empty-pending check to match new nested status structure. |
| react/src/components/FileUploadManager.tsx | Refactored data structures, progress computation, notification messaging, and concurrency. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| bytesUploaded) / | ||
| uploadRequests.totalBytes) * | ||
| 100, | ||
| ) - 1, |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subtracting 1 causes percent to be -1 when progress starts (bytesUploaded = 0), yielding an invalid negative progress value. Remove the - 1 to keep percent within 0–100.
| ) - 1, | |
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ant design's progress handle negative value to zero, I'll keep '-1' to prevent showing progress bar as complete (as green color).
| ...(prev[vFolderId]?.pending.vFolderNames || []), | ||
| ...uploadFilesNames, | ||
| ], | ||
| totalSize: uploadRequests.totalBytes, |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using uploadRequests.totalBytes (aggregate of all folders) for each vFolder's pending.totalSize and progress denominator produces incorrect per-folder percentages when multiple folders upload concurrently. Store per-request bytes (e.g. set uploadRequestInfo.totalBytes at creation) and use that request-specific total in both initialization and percent calculation.
| totalSize: uploadRequests.totalBytes, | |
| totalSize: uploadRequest.totalBytes ?? 0, |
| percent: | ||
| Math.round( | ||
| ((prev[vFolderId]?.completed.totalSize + | ||
| bytesUploaded) / | ||
| uploadRequests.totalBytes) * | ||
| 100, | ||
| ) - 1, |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using uploadRequests.totalBytes (aggregate of all folders) for each vFolder's pending.totalSize and progress denominator produces incorrect per-folder percentages when multiple folders upload concurrently. Store per-request bytes (e.g. set uploadRequestInfo.totalBytes at creation) and use that request-specific total in both initialization and percent calculation.
d5cfaff to
3f7e879
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please apply copilot's reviews and resolve conflicts
3f7e879 to
e5745cb
Compare

Resolves #4316 (FR-1501)
Changes
This PR fixes file upload status tracking issues by refactoring the upload status data structure and improving progress tracking:
Key Changes
Refactored upload status structure
vFolderNamesandtotalSizepropertiescompletedandfailedstates to prevent "not iterable" errorsEnhanced progress tracking
Increased upload concurrency
Updated FolderExplorer
Files Changed
react/src/components/FileUploadManager.tsx- Main refactoringreact/src/components/FolderExplorer.tsx- Minor update for compatibilityChecklist: