Skip to content

fix(database): preserve engine_information when creating database connection#38107

Open
rusackas wants to merge 2 commits intomasterfrom
fix/30504-file-upload-checkbox-missing
Open

fix(database): preserve engine_information when creating database connection#38107
rusackas wants to merge 2 commits intomasterfrom
fix/30504-file-upload-checkbox-missing

Conversation

@rusackas
Copy link
Member

SUMMARY

When creating a new database connection, the "Allow file uploads to database" checkbox was missing from the Advanced options. This checkbox correctly appears when editing an existing connection.

Root Cause:

  1. When selecting a database type, engine_information (containing supports_file_upload) is set from the /api/v1/database/available/ response
  2. After successfully creating the database, the POST response updates state via the Fetched action
  3. The POST response doesn't include engine_information (it's not in add_columns)
  4. The Fetched reducer was overwriting the entire state, losing the engine_information that was previously set
  5. ExtraOptions checks db?.engine_information?.supports_file_upload to determine whether to render the checkbox

Fix:
Preserve engine_information from the existing state when the Fetched action payload doesn't include it. This follows the same pattern already used for engine, parameters, and ssh_tunnel fields in the reducer.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before (CREATE mode): Checkbox missing
After (CREATE mode): Checkbox visible (same as EDIT mode)

(Screenshots from the original issue show the problem)

TESTING INSTRUCTIONS

  1. Navigate to Settings → Database Connections
  2. Click "+ Database" to create a new connection
  3. Select any database type (e.g., PostgreSQL, MySQL)
  4. Fill in the connection details
  5. Click "Connect"
  6. Verify: In the Advanced options that appear after connecting, the "Allow file uploads to database" checkbox should now be visible
  7. Compare with editing an existing database - the checkbox should appear in both cases

ADDITIONAL INFORMATION

🤖 Generated with Claude Code

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 19, 2026

Code Review Agent Run #7150dd

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 3841583..3841583
    • superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
    • superset-frontend/src/features/databases/DatabaseModal/index.tsx
  • Files skipped - 0
  • Tools
    • 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

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Feb 19, 2026
rusackas and others added 2 commits February 22, 2026 14:18
…nection

When creating a new database connection, the "Allow file uploads to
database" checkbox was missing. This was because:

1. When selecting a database, engine_information (containing
   supports_file_upload) was set from the available databases list
2. After creating the database, the POST response was used to update
   state via the Fetched action
3. The POST response doesn't include engine_information, so the
   Fetched reducer was overwriting the state and losing it
4. ExtraOptions checks engine_information.supports_file_upload to
   render the checkbox

The fix preserves engine_information from the existing state when
the Fetched action payload doesn't include it, following the same
pattern used for engine, parameters, and ssh_tunnel fields.

Fixes: #30504

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use ConfigurationMethod.SqlalchemyUri instead of string literal
- Add Partial<DatabaseObject> type annotation for initialState
- Add null check before accessing currentState properties

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rusackas rusackas force-pushed the fix/30504-file-upload-checkbox-missing branch from 3841583 to 147e6f6 Compare February 22, 2026 22:18
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 22, 2026

Code Review Agent Run #1a8ddc

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 51c5a65..147e6f6
    • superset-frontend/src/features/databases/DatabaseModal/index.test.tsx
    • superset-frontend/src/features/databases/DatabaseModal/index.tsx
  • Files skipped - 0
  • Tools
    • 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

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 size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Allow file uploads to database" is missing (when creating a connection)

1 participant