Skip to content

dbeaver/pro#9095 load active connections before checking execution co…#4355

Merged
sergeyteleshev merged 2 commits into
develfrom
dbeaver/pro#9095-datasets-reconnect
May 21, 2026
Merged

dbeaver/pro#9095 load active connections before checking execution co…#4355
sergeyteleshev merged 2 commits into
develfrom
dbeaver/pro#9095-datasets-reconnect

Conversation

@devnaumov

@devnaumov devnaumov commented May 20, 2026

Copy link
Copy Markdown
Member

closes 9095

Some of the data sources return an execution context only if a connection exists at the resource level (datasets, resources, file system, etc.). If no one in the app has loaded the connection, the execution context will always be undefined.

 get executionContext(): IConnectionExecutionContextInfo | undefined {
    if (
      !this.state.executionContext ||
      !this.connectionInfoResource.has(createConnectionParam(this.state.executionContext.projectId, this.state.executionContext.connectionId))
    ) {
      return undefined;
    }
    return this.state.executionContext;
  }

Since datasets are restored at the SQL tab level, I moved the load function up so that we load the connection before checking the execution context. This ensures that the restore process works as expected without side effects from the app.

The only downside is that if every sql tab lacks an execution context, we will load the active project connections. However, this scenario is very unlikely as it would require the UI to be in the VIEWER role (and there datasets have connections anyway), where only the restore behavior load connections (we dont have top bar actions, navigation tree and etc)

@codacy-production

codacy-production Bot commented May 20, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

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.

@sergeyteleshev sergeyteleshev merged commit bccf470 into devel May 21, 2026
10 checks passed
@sergeyteleshev sergeyteleshev deleted the dbeaver/pro#9095-datasets-reconnect branch May 21, 2026 16:22
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.

3 participants