Skip to content

Commit

Permalink
Refresh trace viewer after server URL preference changes
Browse files Browse the repository at this point in the history
For the case that with current URL the welcome view is rendered due to
noExperiment or server is down, this will render the trace explorer
(or welcome view) after a server URL change. Without calling refresh,
the welcome view stays, even if the other server has experiments.

Fixes #229

Signed-off-by: Bernd Hufmann <[email protected]>
  • Loading branch information
bhufmann committed Apr 10, 2024
1 parent 86ade94 commit f012ced
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vscode-trace-common/src/client/tsp-client-provider-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ export class TspClientProvider implements ITspClientProvider {

RestClient.addConnectionStatusListener(status => {
// Ignore the first update that is sent when calling addConnectionStatusListener
if (this._initialized) {
this._signalHandler?.notifyConnection(status);
if (!this._initialized) {
this._initialized = true;
return;
}
this._signalHandler?.notifyConnection(status);
});
this._initialized = true;
this._tspClient.checkHealth(); // When this is called in the remote use-case, it will block the port-forwarding service-worker.
}

Expand Down
3 changes: 3 additions & 0 deletions vscode-trace-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export function activate(context: vscode.ExtensionContext): ExternalAPI {

// Signal the change to all trace panels
TraceViewerPanel.updateTraceServerUrl(newTspClientURL);

// Refresh so that either trace explorer or welcome page is rendered
vscode.commands.executeCommand('trace-explorer.refreshContext');
}
})
);
Expand Down

0 comments on commit f012ced

Please sign in to comment.