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 this PR adds that removal behavior.

Additionally, items are added with 2 separate ids because of an 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 pull request description adequately explains the bug fix, references the issue (#4395), describes the problem and solution, and includes before/after videos demonstrating the fix.

✏️ 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.

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