Repository navigation
fix(databases): reset import file entry after invalid file error - #42240
Conversation
The Upload in the Connect a database modal had no fileList prop, leaving it uncontrolled: antd rendered its own internal list while React state was updated separately. Since customRequest is a no-op that never signals success or failure, antd's entry stayed at status 'uploading' forever and removeFile's setFileList had no effect on what was rendered. Passing fileList makes the component controlled, so the spinner settles and the remove icon clears the entry. Also drops a stale .ant-upload-list-item-card-actions rule, an antd v4 selector that matches nothing in v6.
Code Review Agent Run #9fd883Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42240 +/- ##
==========================================
+ Coverage 65.18% 65.21% +0.02%
==========================================
Files 2768 2768
Lines 156099 156099
Branches 35727 35727
==========================================
+ Hits 101758 101804 +46
+ Misses 52377 52331 -46
Partials 1964 1964
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
Uploading an invalid file under "Import database from file" left the modal stuck: the progress spinner spun forever and the trash icon did nothing. Only closing and reopening the modal cleared it.
The
Uploadhad nofileListprop, so it was uncontrolled — antd rendered its own internal list while React'sfileListstate was updated separately and never displayed. SincecustomRequestis a no-op that never callsonSuccess/onError, antd's entry stayed atstatus: 'uploading'forever (the spinner), andremoveFile'ssetFileListupdated state nobody rendered (the dead trash icon). One cause, both symptoms.Passing
fileListmakes it controlled:onDbImportalready setsstatus: 'done', so the spinner settles and the remove icon clears the entry.Two notes for reviewers:
removeFile'sreturn falselooks like the bug but is load-bearing — returningtruemakes antd fireonChange→onDbImportwith the removed file, starting a bogus re-import..ant-upload-list-item-card-actionsrule: an antd v4 selector that matches nothing in v6, so it was dead code hiding an icon that should work.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:


The spinner shows indefinitely and you can't remove the invalid file
After:
Spinner stops and you can remove invalid file with trash icon
TESTING INSTRUCTIONS
Added a regression test that fails on master with
Received: ant-upload-list-item ant-upload-list-item-uploading— the stuck spinner itself.ADDITIONAL INFORMATION