mirror of
https://github.com/FlowiseAI/Flowise.git
synced 2026-10-12 02:02:17 +00:00
fix: flowise 322 and 324 (#6650)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user