Skip to content

Hotfix/uploadv3 duplicate file max reached#226

Merged
smarcet merged 6 commits intomainfrom
hotfix/uploadv3-duplicate-file-max-reached
Apr 24, 2026
Merged

Hotfix/uploadv3 duplicate file max reached#226
smarcet merged 6 commits intomainfrom
hotfix/uploadv3-duplicate-file-max-reached

Conversation

@smarcet
Copy link
Copy Markdown
Collaborator

@smarcet smarcet commented Apr 23, 2026

ref: https://app.clickup.com/t/86b9gt7w3

Summary by CodeRabbit

  • Bug Fixes

    • Fixed dropzone to prevent duplicate error messages when max files limit is reached.
    • Improved upload component's handling of asynchronous file processing states.
    • Enhanced file completion and reconciliation logic for better upload consistency.
  • Chores

    • Updated package version to 5.0.15-beta.2.

smarcet added 4 commits April 23, 2026 16:40
…uploads

handleFileCompleted now checks file._asyncProcessing and skips marking
complete for async uploads. wrappedOnUploadComplete marks all uploading
files complete when polling confirms server processing is done.
@smarcet smarcet requested a review from santipalenque April 23, 2026 20:26
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@smarcet has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 7 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 7 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a1ad5295-2f50-4778-b849-c991cbf4e528

📥 Commits

Reviewing files that changed from the base of the PR and between 555632c and eb6bb60.

📒 Files selected for processing (2)
  • src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js
  • src/components/inputs/upload-input-v3/index.js
📝 Walkthrough

Walkthrough

Version bump to beta combined with modifications to file upload completion handling. Dropzone now returns early on max files error. UploadInputV3 prevents async-processing files from immediately completing and changes how completed files reconcile with parent values.

Changes

Cohort / File(s) Summary
Version Metadata
package.json
Updated version from 5.0.14 to 5.0.15-beta.2.
Dropzone Component
src/components/inputs/dropzone/index.js
Added early return in accept callback after "Max files reached" error, preventing subsequent done() call execution.
Upload Component Logic
src/components/inputs/upload-input-v3/index.js
Modified upload completion flow to prevent async-processing files from transitioning to complete state immediately; changed parent value reconciliation to remove all completed entries when value has items; updated wrappedOnUploadComplete to mark entries complete before invoking callback.
Upload Component Tests
src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js
Added two edge-case tests: one verifying server-renamed files replace completed uploading rows; another verifying async-processing files remain in loading state rather than completing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Hotfix/async upload ux #225: Both PRs modify async upload completion flow and Dropzone async handling behavior for async-processing files.

Suggested reviewers

  • santipalenque

Poem

🐰 Files upload with async care,
Beta bumps float through the air,
Completion flows now branch and stay,
Async waits for another day! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main fix: addressing duplicate file issues and the max-files-reached behavior in UploadInputV3, which aligns with the core changes across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/uploadv3-duplicate-file-max-reached

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js (1)

311-350: LGTM — new tests lock in both behavioral changes.

The server-rename reconciliation test (L312‑331) guards the root cause of the "max reached" bug, and the _asyncProcessing test (L333‑350) pins the HTTP 202 "stay in Loading" contract.

One small follow-up worth considering (non-blocking): add a test that calls onUploadComplete via dropzoneCallbacks.onUploadComplete(...) and asserts the async row transitions from "Loading" → "Complete" after polling finishes — that's the complementary branch to the _asyncProcessing: true assertion here and exercises wrappedOnUploadComplete directly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js`
around lines 311 - 350, Add a complementary test that triggers the
async-complete branch by calling dropzoneCallbacks.onUploadComplete(...) (which
exercises wrappedOnUploadComplete) for an item with _asyncProcessing true, then
advance timers / mock polling responses until the upload transitions from
"Loading" to "Complete" and assert the UI updates accordingly; specifically,
render UploadInputV3 with maxFiles=1 and value=[], simulate onAddedFile and then
call dropzoneCallbacks.onUploadComplete({ name: 'video.mp4', size: 5000000,
_asyncProcessing: true }), mock the polling endpoint/responses used by
wrappedOnUploadComplete, advance timers as needed, and assert that the row
initially shows "Loading" and eventually shows "Complete".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/inputs/upload-input-v3/index.js`:
- Around line 193-197: wrappedOnUploadComplete currently marks every entry in
uploadingFiles as complete when any single file's onUploadComplete fires; change
it to only mark the file(s) that actually finished. In the setUploadingFiles
callback used in wrappedOnUploadComplete, update only entries whose identifier
matches the dzId parameter (compare dzId to the per-file id field used in
uploadingFiles, e.g., file.id or file.uploadId) or whose progress is 100,
leaving other files unchanged. Keep the existing onUploadComplete(response,
dzId, dzData) forwarding behavior. Ensure you reference wrappedOnUploadComplete,
setUploadingFiles and the uploadingFiles item id/progress fields when making the
change.

---

Nitpick comments:
In `@src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js`:
- Around line 311-350: Add a complementary test that triggers the async-complete
branch by calling dropzoneCallbacks.onUploadComplete(...) (which exercises
wrappedOnUploadComplete) for an item with _asyncProcessing true, then advance
timers / mock polling responses until the upload transitions from "Loading" to
"Complete" and assert the UI updates accordingly; specifically, render
UploadInputV3 with maxFiles=1 and value=[], simulate onAddedFile and then call
dropzoneCallbacks.onUploadComplete({ name: 'video.mp4', size: 5000000,
_asyncProcessing: true }), mock the polling endpoint/responses used by
wrappedOnUploadComplete, advance timers as needed, and assert that the row
initially shows "Loading" and eventually shows "Complete".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e4fee46-8047-49ee-89b3-b5d362700e84

📥 Commits

Reviewing files that changed from the base of the PR and between e279de4 and 555632c.

📒 Files selected for processing (4)
  • package.json
  • src/components/inputs/dropzone/index.js
  • src/components/inputs/upload-input-v3/__tests__/upload-input-v3.test.js
  • src/components/inputs/upload-input-v3/index.js

Comment thread src/components/inputs/upload-input-v3/index.js
Copy link
Copy Markdown
Contributor

@santipalenque santipalenque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

smarcet added 2 commits April 23, 2026 18:25
…n-flight files complete

Only mark uploading rows as complete when their progress has reached
100%, preventing premature completion of still-uploading files in
multi-file (maxFiles > 1) scenarios.
@smarcet smarcet merged commit c10c1be into main Apr 24, 2026
5 checks passed
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