From 2a42ccb0e100872f4aae38aa9b1027e1658d2c3c Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 15 Jul 2025 11:38:48 -0400 Subject: [PATCH] fix for #1285 (#1286) * fix for #1285 * typo --- lib/tasks/say.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/tasks/say.js b/lib/tasks/say.js index cf9ef8c3..d6716c2a 100644 --- a/lib/tasks/say.js +++ b/lib/tasks/say.js @@ -278,7 +278,13 @@ class TaskSay extends TtsTask { try { this.logger.debug({evt}, `Say got playback-stop ${evt.variable_tts_playback_id ? evt.variable_tts_playback_id : ''}`); - const unmatchedResponse = !!evt.variable_tts_playback_id && evt.variable_tts_playback_id !== playbackId; + + /** + * If we got a playback id on both the start and stop events, and they don't match, + * then we must have received a playback-stop event for an earlier play request. + */ + const unmatchedResponse = (!!playbackId && !!evt.variable_tts_playback_id) && + evt.variable_tts_playback_id !== playbackId; if (unmatchedResponse) { this.logger.info({currentPlaybackId: playbackId, stopPPlaybackId: evt.variable_tts_playback_id}, 'Say:exec discarding playback-stop for earlier play');