[PR #22837] [CLOSED] fix: guard audioQueue access to prevent TypeError in Search Chats preview #130541

Closed
opened 2026-05-21 14:49:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22837
Author: @themavik
Created: 3/19/2026
Status: Closed

Base: mainHead: fix/22745-read-aloud-null-audio-queue


📝 Commits (1)

  • b549083 fix: guard audioQueue access to prevent TypeError in Search Chats preview

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+7 -1)

📄 Description

Summary

Fixes #22745.

Root cause: The $audioQueue Svelte store is typed AudioQueue | null and initialized to null. When "Read Aloud" is clicked in the Search Chats preview modal, speak() calls $audioQueue.setId() without a null check, causing TypeError: can't access property "setId", _() is null.

Fix: Added a null guard before accessing $audioQueue methods in speak(), and used optional chaining ($audioQueue?.stop()) in stopAudio().

Changes

  • src/lib/components/chat/Messages/ResponseMessage.svelte: Added null check for $audioQueue at the start of the TTS engine path in speak(), returning early with a toast error if the audio queue is unavailable. Used optional chaining in stopAudio() for the same store.

Testing

  • Verified fix addresses the reported scenario (Read Aloud in Search Chats preview)
  • Change is minimal and follows existing code patterns (optional chaining + early return with toast)
  • No behavioral change when $audioQueue is properly initialized

Made with Cursor


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22837 **Author:** [@themavik](https://github.com/themavik) **Created:** 3/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/22745-read-aloud-null-audio-queue` --- ### 📝 Commits (1) - [`b549083`](https://github.com/open-webui/open-webui/commit/b549083cf4cdd2f5b2dda9a3a14964b516594af8) fix: guard audioQueue access to prevent TypeError in Search Chats preview ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+7 -1) </details> ### 📄 Description ## Summary Fixes #22745. **Root cause:** The `$audioQueue` Svelte store is typed `AudioQueue | null` and initialized to `null`. When "Read Aloud" is clicked in the Search Chats preview modal, `speak()` calls `$audioQueue.setId()` without a null check, causing `TypeError: can't access property "setId", _() is null`. **Fix:** Added a null guard before accessing `$audioQueue` methods in `speak()`, and used optional chaining (`$audioQueue?.stop()`) in `stopAudio()`. ## Changes - `src/lib/components/chat/Messages/ResponseMessage.svelte`: Added null check for `$audioQueue` at the start of the TTS engine path in `speak()`, returning early with a toast error if the audio queue is unavailable. Used optional chaining in `stopAudio()` for the same store. ## Testing - Verified fix addresses the reported scenario (Read Aloud in Search Chats preview) - Change is minimal and follows existing code patterns (optional chaining + early return with toast) - No behavioral change when `$audioQueue` is properly initialized Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 14:49:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#130541