This is an automated email from the ASF dual-hosted git repository.
shanedell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git
The following commit(s) were added to refs/heads/main by this push:
new eb30225 Fix premature shutdown of Ωedit server when multiple data
editor tabs are open
eb30225 is described below
commit eb30225155f6b14df51deba2d163b1453bd435b5
Author: Shane Dell <[email protected]>
AuthorDate: Tue Aug 19 13:18:54 2025 -0400
Fix premature shutdown of Ωedit server when multiple data editor tabs are
open
Closes #1312
---
src/dataEditor/include/server/Sessions.ts | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/dataEditor/include/server/Sessions.ts
b/src/dataEditor/include/server/Sessions.ts
index 2b000c1..7a975d0 100644
--- a/src/dataEditor/include/server/Sessions.ts
+++ b/src/dataEditor/include/server/Sessions.ts
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { destroySession } from '@omega-edit/client'
+import { destroySession, getSessionCount } from '@omega-edit/client'
import { updateHeartbeatInterval } from './heartbeat'
import { serverStop } from '../../dataEditorClient'
@@ -32,5 +32,9 @@ export async function removeActiveSession(sessionId: string) {
activeSessions.splice(index, 1)
updateHeartbeatInterval(activeSessions)
await destroySession(sessionId)
- await serverStop()
+
+ // Only stop the server if there are no active sessions
+ if ((await getSessionCount()) === 0) {
+ await serverStop()
+ }
}