Send metadata event when aborting autoplay TTS

This commit is contained in:
Ilango Rajagopal 2025-09-26 13:49:51 +05:30
parent d2a177db59
commit 50b5bb911a
1 changed files with 4 additions and 1 deletions

View File

@ -187,7 +187,10 @@ const abortTextToSpeech = async (req: Request, res: Response) => {
// Also abort the main chat flow AbortController for auto-TTS
const chatFlowAbortId = `${chatflowId}_${chatId}`
appServer.abortControllerPool.abort(chatFlowAbortId)
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)