mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
fix issue where sometimes ownerUri was null (#7094)
This commit is contained in:
@@ -43,13 +43,12 @@ export class CmsResourceTreeNode extends CmsResourceTreeNodeBase {
|
||||
this.connection.options.password = await this.appContext.cmsUtils.getPassword(this.connection.options.user);
|
||||
}
|
||||
}
|
||||
return this.appContext.cmsUtils.createCmsServer(this.connection, this.name, this.description).then((result) => {
|
||||
// cache new connection is different from old one
|
||||
if (this.appContext.cmsUtils.didConnectionChange(this._connection, result.connection)) {
|
||||
this._connection = result.connection;
|
||||
this._ownerUri = result.ownerUri;
|
||||
this.appContext.cmsUtils.cacheRegisteredCmsServer(this.name, this.description, this.ownerUri, this.connection);
|
||||
}
|
||||
return this.appContext.cmsUtils.createCmsServer(this.connection, this.name, this.description).then(async (result) => {
|
||||
// update the owner uri and the connection
|
||||
this._ownerUri = result.ownerUri;
|
||||
this._connection = result.connection;
|
||||
await this.appContext.cmsUtils.cacheRegisteredCmsServer(this.name, this.description, this.ownerUri, this.connection);
|
||||
|
||||
if (result.listRegisteredServersResult.registeredServersList) {
|
||||
result.listRegisteredServersResult.registeredServersList.forEach((registeredServer) => {
|
||||
nodes.push(new RegisteredServerTreeNode(
|
||||
|
||||
@@ -46,7 +46,7 @@ export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICms
|
||||
server.ownerUri,
|
||||
server.connection,
|
||||
this._appContext, this, null));
|
||||
this.appContext.cmsUtils.cacheRegisteredCmsServer(server.name, server.description,
|
||||
await this.appContext.cmsUtils.cacheRegisteredCmsServer(server.name, server.description,
|
||||
server.ownerUri, server.connection);
|
||||
});
|
||||
return servers;
|
||||
|
||||
Reference in New Issue
Block a user