Skip to content

Commit d5cfc5e

Browse files
Fix regression where switching targets, with the same host, does not trigger a model refresh (#1088)
## Changes Switching targets (with the same host) was not triggering model refresh. This fixes the issue. ## Tests <!-- How is this tested? -->
1 parent 9e05703 commit d5cfc5e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/databricks-vscode/src/configuration/ConnectionManager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ export class ConnectionManager implements Disposable {
138138
this.updateClusterManager,
139139
this
140140
),
141-
// Don't listen to target change for logging in. Explictly listen for changes in the keys we care about.
141+
// Don't just listen to target change for logging in. Also explictly listen for changes in the keys we care about.
142142
// We don't have to listen to changes in authProfile as it's set by the login method and we don't respect other
143143
// user changes.
144144
// TODO: start listening to changes in authParams
145145
this.configModel.onDidChangeKey("host")(
146146
this.loginWithSavedAuth,
147147
this
148+
),
149+
this.configModel.onDidChangeTarget(
150+
this.loginWithSavedAuth,
151+
this
148152
)
149153
);
150154
}

packages/databricks-vscode/src/configuration/models/ConfigModel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ export class ConfigModel implements Disposable {
224224
this.onDidChangeTargetEmitter.fire();
225225
});
226226

227+
await this.setAuthProvider(undefined);
228+
227229
this.vscodeWhenContext.isTargetSet(this._target !== undefined);
228230
}
229231

0 commit comments

Comments
 (0)