Skip to content

fix(databases): reset import file entry after invalid file error - #42240

Merged
msyavuz merged 1 commit into
apache:masterfrom
msyavuz:msyavuz/fix/db-import-upload-stuck-state
Jul 20, 2026
Merged

msyavuz merged 1 commit into
apache:masterfrom
msyavuz:msyavuz/fix/db-import-upload-stuck-state

Conversation

@msyavuz

@msyavuz msyavuz commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

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 Upload had no fileList prop, so it was uncontrolled — antd rendered its own internal list while React's fileList state was updated separately and never displayed. Since customRequest is a no-op that never calls onSuccess/onError, antd's entry stayed at status: 'uploading' forever (the spinner), and removeFile's setFileList updated state nobody rendered (the dead trash icon). One cause, both symptoms.

Passing fileList makes it controlled: onDbImport already sets status: 'done', so the spinner settles and the remove icon clears the entry.

Two notes for reviewers:

  • removeFile's return false looks like the bug but is load-bearing — returning true makes antd fire onChange → onDbImport with the removed file, starting a bogus re-import.
  • Also drops a stale .ant-upload-list-item-card-actions rule: 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:
image
The spinner shows indefinitely and you can't remove the invalid file
After:
image
Spinner stops and you can remove invalid file with trash icon

TESTING INSTRUCTIONS

  1. Settings > Database Connections > + Database
  2. Under "Import database from file", upload a .zip that is not a valid Superset export
  3. Error banner appears; the spinner stops and the trash icon removes the entry, letting you retry without closing the modal

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

  • Has associated issue: No — reported internally
  • Required feature flags: None
  • Changes UI — the upload entry in the DB import modal now resets
  • Includes DB Migration: No
  • Introduces new feature or API: No
  • Removes existing feature or API: No

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.
@dosubot dosubot Bot added change:frontend Requires changing the frontend data:databases Related to database configurations and connections labels Jul 20, 2026
@bito-code-review

bito-code-review Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9fd883

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 10c113f..10c113f
    • superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
    • superset-frontend/src/features/databases/DatabaseModal/index.tsx
    • superset-frontend/src/features/databases/DatabaseModal/styles.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 10c113f
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a5e0d4636bda70008fbb2f3
😎 Deploy Preview https://deploy-preview-42240--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.21%. Comparing base (09148d0) to head (10c113f).
⚠️ Report is 6 commits behind head on master.

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              
Flag Coverage Δ
javascript 70.88% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@msyavuz
msyavuz merged commit c1e660f into apache:master Jul 20, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend data:databases Related to database configurations and connections size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants