fix: read aloud stops after the first failed sentence instead of requesting the rest (#33028)

When one sentence failed to synthesize during Read Aloud, playback ended but every remaining sentence was still sent to the speech provider, each failure showed its own error toast and any audio that came back was thrown away. Read Aloud now requests no further sentences after the first failure, so a provider outage gives one error and no wasted requests.

Fixes #33023
This commit is contained in:
Classic298 2026-10-24 08:04:46 +02:00 • committed by GitHub
parent 8852d460b7
commit ea615c3a2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -334,6 +334,7 @@
for (const [, sentence] of messageContentParts.entries()) {
if (signal.aborted) return;
if (!speaking) break;
const url = await $TTSWorker
.generate({ text: sentence, voice: voiceId })
@ -354,6 +355,7 @@
} else {
for (const [, sentence] of messageContentParts.entries()) {
if (signal.aborted) return;
if (!speaking) break;
const res = await synthesizeOpenAISpeech(localStorage.token, voiceId, sentence).catch(
(error) => {