fix(database): preserve engine_information when creating database connection#38107
fix(database): preserve engine_information when creating database connection#38107
Conversation
Code Review Agent Run #7150ddActionable 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 |
…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>
3841583 to
147e6f6
Compare
Code Review Agent Run #1a8ddcActionable 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 |
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:
engine_information(containingsupports_file_upload) is set from the/api/v1/database/available/responseFetchedactionengine_information(it's not inadd_columns)Fetchedreducer was overwriting the entire state, losing theengine_informationthat was previously setExtraOptionschecksdb?.engine_information?.supports_file_uploadto determine whether to render the checkboxFix:
Preserve
engine_informationfrom the existing state when theFetchedaction payload doesn't include it. This follows the same pattern already used forengine,parameters, andssh_tunnelfields 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
ADDITIONAL INFORMATION
🤖 Generated with Claude Code