Fixing connection without saved password not connecting in Async Server Tree (#22535)

This commit is contained in:
Aasim Khan
2023-03-31 09:19:01 -07:00
committed by GitHub
parent a1acaf2096
commit d49ff85afc
4 changed files with 12 additions and 2 deletions

View File

@@ -472,6 +472,11 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
await this._connectionManagementService.deleteConnection(profile);
}
const connectionProfile = this.getConnectionInTreeInput(profile.id);
// For the connection profile, we need to clear the password from the last session if the user doesn't want to save it
if (!connectionProfile.savePassword) {
connectionProfile.password = '';
}
// Delete the node from the tree
await this._objectExplorerService.deleteObjectExplorerNode(connectionProfile);
// Collapse the node

View File

@@ -270,6 +270,9 @@ export class ConnectionDialogService implements IConnectionDialogService {
showFirewallRuleOnError: true
};
if (params && options.params === undefined) {
options.params = params;
}
try {
const connectionResult = await this._connectionManagementService.connectAndSaveProfile(connection, uri, options, params && params.input);
this._connecting = false;

View File

@@ -416,7 +416,9 @@ export class ConnectionManagementService extends Disposable implements IConnecti
connectionType: this._connectionStatusManager.isEditorTypeUri(owner.uri) ? ConnectionType.editor : ConnectionType.default,
input: owner,
runQueryOnCompletion: RunQueryOnConnectionMode.none,
showDashboard: options.showDashboard
showDashboard: options.showDashboard,
isEditConnection: true,
oldProfileId: connection.id
};
return this.showConnectionDialog(params, options, connection, connectionResult).then(() => {
return connectionResult;

View File

@@ -305,8 +305,8 @@ export class TreeUpdateUtils {
// If the node update takes too long, reject the promise
const nodeUpdateTimeout = () => {
reject(new Error(nls.localize('objectExplorerTimeout', "Object Explorer expansion timed out for '{0}'", connection.databaseName)));
cleanup();
reject(new Error(nls.localize('objectExplorerTimeout', "Object Explorer expansion timed out for '{0}'", connection.databaseName)));
}
const nodeUpdateTimer = setTimeout(nodeUpdateTimeout, expansionTimeoutValueSec * 1000);