Skip to content

609 connection params - #685

Open
vlado-1 wants to merge 6 commits into
BalticAmadeus:developfrom
vlado-1:609-connection-params
Open

609 connection params#685
vlado-1 wants to merge 6 commits into
BalticAmadeus:developfrom
vlado-1:609-connection-params

Conversation

@vlado-1

@vlado-1 vlado-1 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fix #609: Fetch Latest Database Configurations Dynamically in Query Editor

Used Google Gemini AI to write the below.

Problem

Previously, the Query Editor stored a cached database configuration available at the time of its creation and would not receive updates if a user subsequently modified connection parameters.

Attempting to resolve this via the sidebar views (TablesListProvider, CustomViewProvider, or FavoritesProvider) was insufficient because they also held stale, cached configurations that only refreshed upon manual database group re-selection.


Solution

Refactored configuration management to eliminate stale caching entirely. Instead of propagating snapshot-in-time config objects down to individual sidebar views, providers now query a single source of truth dynamically from the underlying extension state.

  • Centralized Configuration Lookup: Added getConfigByGroup(groupId) to GroupListProvider to retrieve live connection settings dynamically from VS Code's globalState or workspaceState storage on demand.
  • Injected Provider References: Injected a reference of GroupListProvider directly into TablesListProvider, FavoritesProvider, and CustomViewProvider. These views now invoke getLatestConfig(dbId) dynamically rather than operating on a stale internal this.configs array.
  • Dynamic Table Population: Updated TablesListProvider to query this.groupList.getSelectedConfigs() during its tree loading state (getGroupNode), ensuring it dynamically pulls tables for all actively highlighted database configurations managed by the GroupListProvider.
  • Decoupled View Refreshing: Simplified tree view provider methods. Cleaned up .refresh() signatures so they no longer expect arrays of data passed as parameters.

Codebase Changes Impact

src/treeview/

  • GroupListProvider.ts: Implemented getConfigByGroup() to dynamically read active configurations from storage by group ID. Maintained selectedConfigs internally and triggered contextual view refreshes clean of parameter-passing bloat.
  • TablesListProvider.ts: Replaced the local this.configs state cache with this.getLatestConfig(node.dbId) prior to invoking background processor data logic. Refactored getGroupNode() to fetch selected configs straight from the injected GroupListProvider.
  • CustomViewProvider.ts & FavoritesProvider.ts: Cleaned out stale initialization loops. Replaced local .some() array iterations with active state evaluations using getLatestConfig(id) !== undefined.

src/ and src/webview/

  • extension.ts: Streamlined extension activation orchestration. Properly passed the GroupListProvider context to secondary tree providers to establish a proper state dependency layout.
  • QueryEditor.ts: Updated internal mechanics to dynamically query current config setups rather than relying on stale configuration captures from initialization.

Test Coverage & Verification

Note: Verified functionality against mock data by monitoring DB Processor console messages to validate live configuration ingestion (no native OpenEdge environment required).

  • Live Parameter Updates (Open Editor): Modified connection properties while a Query Editor instance was active; verified it successfully processed requests using the updated configuration.
  • Live Parameter Updates (New Editor): Modified connection properties, opened a new Query Editor, and verified it initialized with new configurations.
  • Cross-Group Target Switching: Opened a Query Editor, selected an entirely different database group, and verified the previously opened editor still correctly targeted its original, non-selected database group.
  • Multi-Editor Isolation: Opened several Query Editors pointing to distinct database groups simultaneously; verified query routing integrity across all of them.
  • Multi-Group Selection Layout: Selected multiple database groups concurrently and verified the aggregate table list accurately combined all tables.
  • Custom View State Synchronization: Saved a custom view view, modified its base connection parameters, and verified updates propagated instantly to the view container.

@vlado-1
vlado-1 marked this pull request as ready for review July 10, 2026 09:25
@darkeris345

Copy link
Copy Markdown
Collaborator

@vlado-1 I will check this one and let you know when merged.

@darkeris345
darkeris345 self-requested a review July 28, 2026 13:30
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.

Editing database connection params doesn't update actual connection string

2 participants