fix(content-drive): upload-button flow drops the file in Chrome (#36279 follow-up)#36352
Merged
Conversation
The Upload-button flow silently dropped the file in Chrome: onFileChange read input.files (a live FileList) but reset input.value='' BEFORE the guard, which empties that same live FileList, so files.length was 0 and the upload no-oped. Consume the files (capture the File into FormData via resolveFilesUpload) before resetting the input. Adds a regression test (verified red on the old ordering, green on the fix) that models the live-FileList behavior jsdom doesn't reproduce. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
Contributor
|
Claude finished @zJaaal's task in 48s —— View job Rollback Safety Analysis
Result: ✅ Safe To RollbackThe changes in this PR are purely frontend/TypeScript — no backend, database, Elasticsearch, or API contract changes are involved. Files changed:
Against every unsafe category:
Rolling back this change reverts the fix, restoring the Chrome-specific bug where uploading via the button silently did nothing. No data loss or system instability. Label applied: AI: Safe To Rollback |
Contributor
🤖 dotBot Review (Bedrock)Reviewed 2 file(s); 0 candidate(s) → 0 confirmed, 0 uncertain (unverified, kept for review). ✅ No issues found after verification. us.deepseek.r1-v1:0 · Run: #28383471567 · tokens: in: 6635 · out: 1241 · total: 7876 · calls: 3 · est. ~$0.016 |
rjvelazco
approved these changes
Jun 29, 2026
dario-daza
approved these changes
Jun 29, 2026
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Follow-up to #36317 (merged). The Content Drive Upload-button flow silently dropped the selected file in Chrome — the OS picker opened, you chose a file, and nothing happened (no upload, no error).
Root cause
onFileChangereadinput.files(a liveFileList) but resetinput.value = ''before the guard/consume. Clearing the input empties that same liveFileList, sofiles.lengthwas0by the time the code checked it → silent early-return, upload never fired. (The drag-and-drop flow was unaffected — it never goes through the file input.)Fix
Consume the files — fire
resolveFilesUpload, which captures theFileintoFormDatasynchronously — before resetting the input.Checklist
should consume the file before resetting the input (live FileList)) that models the live-FileListsemantics jsdom doesn't reproduce (the existing test stubbedfilesas a static array, which is why this slipped through).portlets-content-drivesuite green (668 tests).Testing
🤖 Generated with Claude Code
This PR fixes: #36279
This PR fixes: #36279