From cc1751f500a730069d5b6d69c75c0e02c46ed540 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 27 Nov 2025 11:44:49 -0600 Subject: [PATCH] =?UTF-8?q?fix=20race=20condition=20where=20gather=20resol?= =?UTF-8?q?ves=20with=20speech=20transcript=20but=20t=E2=80=A6=20(#1449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix race condition where gather resolves with speech transcript but timeout timer gets set after the resolve and is left running after gather completes * remove unneeded line of code --- lib/tasks/gather.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 6ccfda36..9e3ff309 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -258,7 +258,7 @@ class TaskGather extends SttTask { startDtmfListener(); } this._stopVad(); - if (!this.killed) { + if (!this.killed && !this.resolved) { startListening(cs, ep); if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { this.logger.debug('Gather:exec - starting transcription timers after say completes'); @@ -296,7 +296,7 @@ class TaskGather extends SttTask { startDtmfListener(); } this._stopVad(); - if (!this.killed) { + if (!this.killed && !this.resolved) { startListening(cs, ep); if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) { this.logger.debug('Gather:exec - starting transcription timers after play completes');