Skip to content

Conversation

@ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Oct 20, 2025

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

  1. Refactored upload status structure

    • Changed from simple arrays to objects with vFolderNames and totalSize properties
    • Properly initialized completed and failed states to prevent "not iterable" errors
  2. Enhanced progress tracking

    • Added proper byte counting for upload progress
    • Improved notification messages to show upload count (e.g., "5 / 10 files")
    • Progress percentage now based on total bytes uploaded
  3. Increased upload concurrency

    • Changed PQueue concurrency from 1 to 10 for better performance
    • Enables multiple files to upload simultaneously
  4. Updated FolderExplorer

    • Modified to work with new upload status structure

Files Changed

  • react/src/components/FileUploadManager.tsx - Main refactoring
  • react/src/components/FolderExplorer.tsx - Minor update for compatibility

Checklist:

  • Documentation
  • Minimum required manager version
  • Specific setting for review
  • Minimum requirements to check during review
  • Test case: Upload multiple files and verify status tracking works correctly

@github-actions github-actions bot added the size:L 100~500 LoC label Oct 20, 2025
Copy link
Contributor Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@ironAiken2 ironAiken2 marked this pull request as ready for review October 20, 2025 05:12
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 05:12
@github-actions
Copy link

github-actions bot commented Oct 20, 2025

Coverage report for ./react

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

Copy link
Contributor

Copilot AI left a 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,
Copy link

Copilot AI Oct 20, 2025

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.

Suggested change
) - 1,
),

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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,
Copy link

Copilot AI Oct 20, 2025

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.

Suggested change
totalSize: uploadRequests.totalBytes,
totalSize: uploadRequest.totalBytes ?? 0,

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +148
percent:
Math.round(
((prev[vFolderId]?.completed.totalSize +
bytesUploaded) /
uploadRequests.totalBytes) *
100,
) - 1,
Copy link

Copilot AI Oct 20, 2025

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.

Copilot uses AI. Check for mistakes.
@ironAiken2 ironAiken2 force-pushed the fix/FR-1501-file-upload-status-tracking branch from d5cfaff to 3f7e879 Compare October 20, 2025 07:23
Copy link
Contributor

@agatha197 agatha197 left a 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

@ironAiken2 ironAiken2 force-pushed the fix/FR-1501-file-upload-status-tracking branch from 3f7e879 to e5745cb Compare October 22, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance the file upload logic to support multi-file uploads in the upload queue, and update the notification display accordingly

2 participants