feat(content-uploader): implement cancel all freeze
Context: In the modernized Uploads Manager the new feature "cancel all" is slow in the UI. Users have to click cancel all and then confirm the in the modal. In order to make operation a bit faster we decided to pause upload at the time user clicks cancel all.
Summary by CodeRabbit
-
New Features
- Added pause/resume support for uploads, including freezing active uploads and continuing them later.
- Improved the cancel-all flow so pending uploads can be temporarily paused and then resumed from the modal.
-
Bug Fixes
- Prevented new uploads and chunk processing from starting while uploads are paused.
- Kept progress unchanged while uploads are frozen, avoiding confusing UI updates.
-
Tests
- Expanded coverage for paused/resumed upload behavior and cancel-all modal interactions.
No actionable comments were generated in the recent review. π
βΉοΈ Recent review info
βοΈ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bf616420-0050-434f-a9f2-ec2dbe6f8918
π₯ Commits
Reviewing files that changed from the base of the PR and between a2b499e2e44639b1cf7255acd312a6889bfa3d12 and f2950724a4521faf68cbbee73892fe8e9bddae58.
π Files selected for processing (2)
src/elements/content-uploader/ContentUploader.tsxsrc/elements/content-uploader/__tests__/ContentUploader.test.js
π§ Files skipped from review as they are similar to previous changes (2)
- src/elements/content-uploader/tests/ContentUploader.test.js
- src/elements/content-uploader/ContentUploader.tsx
Walkthrough
Adds pause and resume support to MultiputUpload and uses it in ContentUploader to freeze in-progress uploads during Cancel All, then resume chunked and plain uploads when the modal is dismissed.
Changes
Pause/Resume Upload Flow
| Layer / File(s) | Summary |
|---|---|
MultiputUpload paused state src/api/uploads/MultiputUpload.js |
Adds isPaused, gates digest and part-upload scheduling on paused state, and introduces pause() and unpause(). |
MultiputUpload pause tests src/api/uploads/__tests__/MultiputUpload.test.js |
Expands paused-state coverage for scheduling checks and adds unit tests for pause and unpause behavior. |
ContentUploader Cancel All pause/resume src/elements/content-uploader/ContentUploader.tsx |
Adds cancel-all paused state, chunked-upload detection, upload gating, and pause/resume handlers for chunked and plain uploads. |
ContentUploader Cancel All tests src/elements/content-uploader/__tests__/ContentUploader.test.js |
Updates cancel-all tests to assert frozen uploads, chunked pause and resume calls, folder exclusion, and upload suppression while paused. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Possibly related PRs
- box/box-ui-elements#4577: Updates
ContentUploadercancel-all handling and cancel outcomes in the same upload flow. - box/box-ui-elements#4579: Adds the cancel-all confirmation modal flow that this PR hooks into for pause/resume behavior.
Suggested reviewers: jpan-box, olehrybak
Poem
A bunny pauses with a hop,
Then lets the upload traffic stop.
Chunked hops snooze, plain hops reset,
Until the modalβs done with chat.
π
π₯ 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 matches the main change: adding cancel-all freeze behavior in ContentUploader. |
| 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. |
β¨ Finishing Touches
π Generate docstrings
- [ ] Create stacked PR
- [ ] Commit on current branch
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Commit unit tests in branch
preserve-upload-cancel-state
[!WARNING] Tools execution failed with the following error:
Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
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.
Comment @coderabbitai help to get the list of available commands.
Merge Queue Status
- β
Entered queue β
2026-07-09 10:54 UTCΒ· Rule:Automatic strict mergeΒ· triggered by ruleAutomatic merge queue - β Checks passed Β· in-place
- β
Merged β
2026-07-09 11:05 UTCΒ· atf2950724a4521faf68cbbee73892fe8e9bddae58Β· squash
This pull request spent 11 minutes in the queue, including 10 minutes 43 seconds running CI.
Required conditions to merge
github-review-approved[π‘ GitHub branch protection]- [X] #4665
github-review-decision = APPROVED[π‘ GitHub branch protection]- [X] #4665
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Summary - [ ]
check-neutral = Summary - [ ]
check-skipped = Summary
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = lint_test_build - [ ]
check-neutral = lint_test_build - [ ]
check-skipped = lint_test_build
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = license/cla - [ ]
check-neutral = license/cla - [ ]
check-skipped = license/cla
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = lint_pull_request - [ ]
check-neutral = lint_pull_request - [ ]
check-skipped = lint_pull_request
- [X]