Skip to content

dbeaver/pro#10177 pass defaults to main properties - #4538

Merged
devnaumov merged 5 commits into
develfrom
dbeaver/pro#10177-main-properties
Aug 20, 2026
Merged

devnaumov merged 5 commits into
develfrom
dbeaver/pro#10177-main-properties

Conversation

@devnaumov

@devnaumov devnaumov commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

closes 10177

Root cause: formState was published before initialization completed. The mounted form triggered useAutoLoad(), racing with setDriverId() and overwriting driver defaults via setInitialState().

Fix: Initialize ConnectionFormState and ConnectionFormOptionsPart locally, load driver defaults, apply config, then assign the completed state to this.formState. getDefaults() now also preserves the current Options state.

@codacy-production

codacy-production Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

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.

// Don't call load in create mode. There we rely on the defaults set here, and useAutoLoad will load the part on mount.
if (this.formState.mode === FormMode.Edit) {
await this.optionsPart?.load();
}

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.

Something is off here

Previously we waited for part being loaded and set initialState. And only then we went to setting driverId and all attached config to it. And it was pretty straightforward and imperative for both form modes: create and edit

Right now it smells like race condition. What if in create mode we resolve setDriverId() before the optionsPart is actually loaded and set initialState?

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.

What was the original issue here? Maybe we can resolve it differently?

@devnaumov
devnaumov merged commit 3e9e71c into devel Aug 20, 2026
6 checks passed
@devnaumov
devnaumov deleted the dbeaver/pro#10177-main-properties branch August 20, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants