From dbec8f9fd3c42faab49416fe81ff1774a5344cba Mon Sep 17 00:00:00 2001 From: Ilango Date: Fri, 24 Jul 2026 19:28:32 +0530 Subject: [PATCH] fix: flowise 322 and 324 (#6650) --- .../server/src/controllers/text-to-speech/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/server/src/controllers/text-to-speech/index.ts b/packages/server/src/controllers/text-to-speech/index.ts index 6e8bb01ba..d2d848e53 100644 --- a/packages/server/src/controllers/text-to-speech/index.ts +++ b/packages/server/src/controllers/text-to-speech/index.ts @@ -38,6 +38,12 @@ const generateTextToSpeech = async (req: Request, res: Response) => { } else { // Fallback: get workspaceId from chatflow when req.user.activeWorkspaceId is not set (from whitelist API) chatflow = await chatflowsService.getChatflowById(chatflowId) + if (!chatflow.isPublic) { + throw new InternalFlowiseError( + StatusCodes.UNAUTHORIZED, + `Error: textToSpeechController.generateTextToSpeech - unauthorized access to non-public chatflow!` + ) + } workspaceId = chatflow.workspaceId } @@ -199,13 +205,6 @@ const abortTextToSpeech = async (req: Request, res: Response) => { const ttsAbortId = `tts_${chatId}_${chatMessageId}` appServer.abortControllerPool.abort(ttsAbortId) - // Also abort the main chat flow AbortController for auto-TTS - const chatFlowAbortId = `${chatflowId}_${chatId}` - if (appServer.abortControllerPool.get(chatFlowAbortId)) { - appServer.abortControllerPool.abort(chatFlowAbortId) - appServer.sseStreamer.streamMetadataEvent(chatId, { chatId, chatMessageId }) - } - // Send abort event to client appServer.sseStreamer.streamTTSAbortEvent(chatId, chatMessageId)