Skip to content

Conversation

@jfox-box
Copy link
Contributor

@jfox-box jfox-box commented Jan 28, 2026

Fixes a bug in ContentUploader #4395

ContentUploader keeps a map of fileIds to avoid deduplication. But when removing an item, there was no logic to remove the item id from that map, so re-adding the same item would result in nothing happening. This PR fixes it to properly remove ids when removing an item.

Also, items are added with 2 separate ids because of a specific interaction with .pkg files, so this actually has to remove both ids.

Before:

Screen.Recording.2026-01-27.at.5.41.31.PM.mov

After:

Screen.Recording.2026-01-27.at.5.42.01.PM.mov

Summary by CodeRabbit

Bug Fixes

  • Fixed an issue where canceled uploads prevented the same file from being re-uploaded.

✏️ Tip: You can customize this high-level summary in your review settings.

@jfox-box jfox-box requested review from a team as code owners January 28, 2026 01:34
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

The changes add cleanup logic to the ContentUploader component that removes internal file tracking IDs when files are cancelled from the upload queue, enabling those same files to be re-uploaded without being filtered out. A test case verifies this re-upload capability.

Changes

Cohort / File(s) Summary
ContentUploader Component
src/elements/content-uploader/ContentUploader.tsx
Adds ID cleanup in removeFileFromUploadQueue: computes simpleFileId and fullFileId from the file and deletes both from itemIdsRef.current, allowing the same file to be re-added to the upload queue
ContentUploader Tests
src/elements/content-uploader/__tests__/ContentUploader.test.js
Adds test case "should allow re-uploading after cancellation" to verify that file tracking IDs are removed and the file can be re-added via getNewFiles()

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • greg-in-a-box
  • jpan-box
  • tjiang-box

Poem

🐰 A file was lost, could not return,
Its tracking ID would ever burn,
But now we clean the map with care,
Re-upload flows through morning air! 📤✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing file IDs from itemIds when cancelling an upload item, which aligns with the core fix in ContentUploader.tsx.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description provides a clear summary of the bug fix with links to before/after behavior, but does not follow the repository's template structure for contribution guidance.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@mergify
Copy link
Contributor

mergify bot commented Jan 28, 2026

Merge Queue Status

✅ The pull request has been merged at c150806

This pull request spent 11 minutes 4 seconds in the queue, including 10 minutes 55 seconds running CI.
The checks were run in-place.

Required conditions to merge

@mergify mergify bot merged commit 90fb1d7 into master Jan 28, 2026
11 checks passed
@mergify mergify bot deleted the content-uploader-reupload-item branch January 28, 2026 21:49
@mergify mergify bot removed the queued label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants