box-ui-elements icon indicating copy to clipboard operation
box-ui-elements copied to clipboard

feat(content-uploader): implement cancel all freeze

Open dealwith opened this issue 5 months ago β€’ 1 comments

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.

dealwith avatar Jun 30 '26 14:06 dealwith

Review Change Stack

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.tsx
  • src/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

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.

❀️ Share

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

coderabbitai[bot] avatar Jun 30 '26 14:06 coderabbitai[bot]

Merge Queue Status

  • βœ… Entered queue β€” 2026-07-09 10:54 UTC Β· Rule: Automatic strict merge Β· triggered by rule Automatic merge queue
  • βœ… Checks passed Β· in-place
  • βœ… Merged β€” 2026-07-09 11:05 UTC Β· at f2950724a4521faf68cbbee73892fe8e9bddae58 Β· 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] any of [πŸ›‘ GitHub branch protection]:
    • [X] check-success = lint_test_build
    • [ ] check-neutral = lint_test_build
    • [ ] check-skipped = lint_test_build
  • [X] any of [πŸ›‘ GitHub branch protection]:
    • [X] check-success = license/cla
    • [ ] check-neutral = license/cla
    • [ ] check-skipped = license/cla
  • [X] any of [πŸ›‘ GitHub branch protection]:
    • [X] check-success = lint_pull_request
    • [ ] check-neutral = lint_pull_request
    • [ ] check-skipped = lint_pull_request

mergify[bot] avatar Jul 09 '26 10:07 mergify[bot]