From 901e412343b4f9dc57c69feffa6e714d02893328 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 25 Jan 2024 08:48:22 -0500 Subject: [PATCH] fix bug where final transcript with finished header results in timeout (#624) --- lib/tasks/gather.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 09a1cf2d..4ff63210 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -624,7 +624,9 @@ class TaskGather extends SttTask { if (evt.is_final) { if (evt.alternatives[0].transcript === '' && !this.callSession.callGone && !this.killed) { emptyTranscript = true; - if (finished === 'true' && ['microsoft', 'deepgram'].includes(this.vendor)) { + if (finished === 'true' && + ['microsoft', 'deepgram'].includes(this.vendor) && + this._bufferedTranscripts.length === 0) { this.logger.debug({evt}, 'TaskGather:_onTranscription - got empty transcript from old gather, disregarding'); return; }