Summary
In lib/core/extensions/extension_driver_session.dart, targetForExtension resolves which live session should execute a command triggered from Command Palette (Ctrl+P):
ExtensionCommandTarget targetForExtension(
String extensionId, {
int? preferredConnectionId,
}) {
return resolveExtensionCommandTarget(
extensionId: extensionId,
liveConnectionIds: [
for (final entry in _bridges.entries)
if (entry.value.isStarted) entry.key,
],
extensionIdFor: (id) => _manifests[id]?.id,
preferredConnectionId: preferredConnectionId,
);
}
If a user has multiple active connections of the same extension driver (e.g. "ClickHouse Dev" and "ClickHouse Prod") and triggers an extension command (e.g. "Optimize Partition" or "Inspect Storage") while focused on a neutral tab, resolveExtensionCommandTarget arbitrarily picks the first live connection ID.
This can result in executing maintenance or mutation commands on the wrong server (e.g. inadvertently running against production).
Scope
• When multiple live connections for the same extension exist and neither is active in the current workspace tab, do not silently pick the first connection ID.
• Prompt the user with a quick picker modal / bottom sheet to select the target connection before executing the command.
• Add test cases for multi-session command targeting.
Out of scope
• Built-in SQL workspace connection switching.
Summary
In
lib/core/extensions/extension_driver_session.dart,targetForExtensionresolves which live session should execute a command triggered from Command Palette (Ctrl+P):If a user has multiple active connections of the same extension driver (e.g. "ClickHouse Dev" and "ClickHouse Prod") and triggers an extension command (e.g. "Optimize Partition" or "Inspect Storage") while focused on a neutral tab,
resolveExtensionCommandTargetarbitrarily picks the first live connection ID.This can result in executing maintenance or mutation commands on the wrong server (e.g. inadvertently running against production).
Scope
• When multiple live connections for the same extension exist and neither is active in the current workspace tab, do not silently pick the first connection ID.
• Prompt the user with a quick picker modal / bottom sheet to select the target connection before executing the command.
• Add test cases for multi-session command targeting.
Out of scope
• Built-in SQL workspace connection switching.