From 9043998bfd0ef2344f75c308466c2a9907fadfc4 Mon Sep 17 00:00:00 2001 From: Sakshi Sharma <57200045+SakshiS-harma@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:02:16 -0700 Subject: [PATCH] Update session dropdown and fix running state info (#24019) * Update session dropdown and fix running state info * Update comment --- src/sql/workbench/contrib/profiler/browser/profilerEditor.ts | 4 ++-- .../workbench/services/profiler/browser/profilerService.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts index fce0f7642a..58b627de9f 100644 --- a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts +++ b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts @@ -553,7 +553,7 @@ export class ProfilerEditor extends EditorPane { this._profilerService.launchCreateSessionDialog(this.input); } - if (previousSessionName) { // skip updating session selector if there is no previous session name + if (!this.input.isFileSession) { // skip updating session selector for File session to block starting another session from a non-connected file session this._updateSessionSelector(previousSessionName); } } else { @@ -581,7 +581,7 @@ export class ProfilerEditor extends EditorPane { } if (this.input.state.isStopped) { this._updateToolbar(); - if (!this.input.isFileSession) { // skip updating session selector for File sessions + if (!this.input.isFileSession) { // skip updating session selector for File sessions to block starting another session from a non-connected file session this._updateSessionSelector(); } } diff --git a/src/sql/workbench/services/profiler/browser/profilerService.ts b/src/sql/workbench/services/profiler/browser/profilerService.ts index 093b738742..f6dabd5579 100644 --- a/src/sql/workbench/services/profiler/browser/profilerService.ts +++ b/src/sql/workbench/services/profiler/browser/profilerService.ts @@ -161,7 +161,7 @@ export class ProfilerService implements IProfilerService { this.updateMemento(id, { previousSessionName: sessionName }); try { await this._runAction(id, provider => provider.startSession(this._idMap.get(id)!, sessionName, sessionType)); - let isRunning = sessionType === ProfilingSessionType.RemoteSession ? true : false; // Reading session stops when the file reading completes + let isRunning = sessionType === ProfilingSessionType.LocalFile ? false : true; // Reading session stops when the file reading completes this._sessionMap.get(this._idMap.reverseGet(id)!)!.onSessionStateChanged({ isRunning: isRunning, isStopped: false, isPaused: false }); return true;