[PR #22845] [CLOSED] fix: skip message data fetch for pending/optimistic messages #130548

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

📋 Pull Request Information

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

Base: devHead: fix/22753-channel-message-data-404


📝 Commits (1)

  • 6acb54e fix: skip message data fetch for pending/optimistic messages (#22753)

📊 Changes

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

View changed files

📝 src/lib/components/channel/Messages/Message.svelte (+2 -2)

📄 Description

Summary

Fixes #22753.

Root cause: loadMessageData() in Message.svelte runs on mount for any message with truthy data, including optimistic messages that use a temporary UUID as their id. The backend returns 404 because no DB record exists for the temp ID, causing an unhandled promise rejection.

Fix: Added !pending guard to both loadMessageData() and the onMount call, so the API call is only made for messages that have a real server-assigned ID.

Changes

  • src/lib/components/channel/Messages/Message.svelte: Added !pending check before calling getMessageData() in both loadMessageData() and onMount().

Testing

  • Verified fix prevents 404 errors for optimistic/pending messages
  • No behavioral change for confirmed messages (pending=false)
  • Change is minimal (2 lines) and follows existing patterns (pending prop is already used for opacity styling)

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/22845 **Author:** [@themavik](https://github.com/themavik) **Created:** 3/19/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/22753-channel-message-data-404` --- ### 📝 Commits (1) - [`6acb54e`](https://github.com/open-webui/open-webui/commit/6acb54e120eade94f544c80f14a1faae71aa6370) fix: skip message data fetch for pending/optimistic messages (#22753) ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/channel/Messages/Message.svelte` (+2 -2) </details> ### 📄 Description ## Summary Fixes #22753. **Root cause:** `loadMessageData()` in `Message.svelte` runs on mount for any message with truthy `data`, including optimistic messages that use a temporary UUID as their `id`. The backend returns 404 because no DB record exists for the temp ID, causing an unhandled promise rejection. **Fix:** Added `!pending` guard to both `loadMessageData()` and the `onMount` call, so the API call is only made for messages that have a real server-assigned ID. ## Changes - `src/lib/components/channel/Messages/Message.svelte`: Added `!pending` check before calling `getMessageData()` in both `loadMessageData()` and `onMount()`. ## Testing - Verified fix prevents 404 errors for optimistic/pending messages - No behavioral change for confirmed messages (pending=false) - Change is minimal (2 lines) and follows existing patterns (pending prop is already used for opacity styling) 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:50:51 -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#130548