fix: flowise 322 and 324 (#6650)

This commit is contained in:
Ilango
2026-07-24 19:28:32 +05:30
committed by GitHub
parent e816d26a7d
commit dbec8f9fd3
@@ -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)