dbeaver/pro#10480 fixes driver properties form flow - #4652
sergeyteleshev wants to merge 19 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates connection form preparation and formatting so driver, SSL, and SSH properties are normalized before submission.
Changes:
- Moves driver property configuration into
prepare. - Trims driver, SSL, and SSH state/configuration values.
File summaries
| File | Description |
|---|---|
| webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts | Updated as part of this pull request. |
| webapp/packages/plugin-connection-network-handlers/src/SSL/ConnectionFormSSLPart.ts | Updated as part of this pull request. |
| webapp/packages/plugin-connection-network-handlers/src/SSH/ConnectionFormSSHPart.ts | Updated as part of this pull request. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
One or more issues must be addressed before approval.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts:81
- This request now runs during the prepare phase, before later format handlers have normalized the connection config and before any later-registered network-handler parts have prepared their configs. In particular,
ConnectionFormOptionsPart.formattrimsurl, while its prepare resetsnetworkHandlersConfigand SSL/SSH prepare handlers append to it; because those panels are lazy, opening Driver Properties before SSH/SSL makes this call send an untrimmed URL and incomplete handler config togetConnectionDriverProperties. The previous call informatran after those steps, so keep this assignment informat(or otherwise order it after the dependent handlers).
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
…m parts due to it is trimmed for external parts in prepare method
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate lifecycle, request-duplication, SSL-trimming, and API-compatibility issues remain.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (5)
webapp/packages/core-ui/src/Form/FormPart.ts:49
- This modified source file still has a 2024 copyright end year. Per the repository source-file convention, update the ending year to 2026 when changing the file.
this.formState.prepareTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.prepare.bind(this)));
webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/ConnectionFormDriverPropertiesPart.ts:79
useDriverProperties.load()now executesprepareTask, so this handler callsgetPropertiesConfig(), which performs agetConnectionDriverPropertiesrequest at line 98; the hook then immediately performs the same request again at line 64. This doubles descriptor traffic on every Driver Properties refresh and adds a remote request to every validation/save while this part is loaded. Reuse the descriptor result or keep the metadata fetch out ofprepare().
protected override async prepare(): Promise<void> {
this.optionsPart.state.properties = await this.getPropertiesConfig();
}
webapp/packages/plugin-connections/src/ConnectionForm/DriverProperties/useDriverProperties.ts:64
- Calling
prepareTaskdispatches every loaded part. OnceConnectionFormDriverPropertiesPartis loaded, its newprepare()callsgetPropertiesConfig()/getConnectionDriverProperties, and the next line calls the same resource again with the same config. Reopening or refreshing this tab therefore performs two sequential GraphQL requests; avoid fetching in both paths or reuse the prepared result.
await this.payload.formState.prepareTask.execute(this.payload.formState);
this.promise = this.connectionInfoResource.getConnectionDriverProperties(this.payload.formState.state.projectId, this.payload.config);
webapp/packages/plugin-network-handlers/src/SSH/sshHelpers.ts:46
- This helper is re-exported by
plugin-network-handlers/src/index.ts, so deleting the named export is a breaking package API change for downstream plugins even though this checkout has no remaining callers. Please retain a deprecated compatibility wrapper while migrating the internal caller, unless this package is explicitly allowed to remove released APIs.
export function prepareSSHHandlerConfig(
webapp/packages/plugin-network-handlers/src/SSH/sshHelpers.ts:70
- Please add a regression test for the nested-properties copy. This change is intended to make
trimSSHConfigavoid mutating its input, butsshHelpers.test.tsno longer callstrimSSHConfig(the removedgetSSHHandlerConfigtest was its only indirect coverage), so this behavior is currently unprotected.
const trimmedInput = {
...toJS(input),
properties: input.properties ? { ...toJS(input.properties) } : input.properties,
};
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Lite
| contexts: IExecutionContextProvider<IFormState<IConnectionFormState>>, | ||
| ): void | Promise<void> { | ||
| const urlType = this.optionsPart.state.configurationType === DriverConfigurationType.Url; | ||
| const requiresCredentials = this.state.enabled && !this.state.savePassword; |
There was a problem hiding this comment.
please keep existing logic, only move it from format to prepare
closes https://github.com/dbeaver/pro/issues/10480