From 07e8b4a9ba920319fe6bf8dabe6d92b2bd94b05d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 12:54:58 +0000 Subject: [PATCH] Fix error handler in LogStreamManager to avoid race conditions Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- back/shared/logStreamManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/back/shared/logStreamManager.ts b/back/shared/logStreamManager.ts index fb6a4ae9..815ce409 100644 --- a/back/shared/logStreamManager.ts +++ b/back/shared/logStreamManager.ts @@ -32,7 +32,8 @@ export class LogStreamManager extends EventEmitter { // Handle stream errors stream.on('error', (error) => { this.emit('error', { filePath, error }); - this.closeStream(filePath); + // Remove the stream from the map on error + this.streams.delete(filePath); reject(error); }); }