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)
🔄 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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22845
Author: @themavik
Created: 3/19/2026
Status: ❌ Closed
Base:
dev← Head:fix/22753-channel-message-data-404📝 Commits (1)
6acb54efix: 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()inMessage.svelteruns on mount for any message with truthydata, including optimistic messages that use a temporary UUID as theirid. The backend returns 404 because no DB record exists for the temp ID, causing an unhandled promise rejection.Fix: Added
!pendingguard to bothloadMessageData()and theonMountcall, 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!pendingcheck before callinggetMessageData()in bothloadMessageData()andonMount().Testing
Made with Cursor
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.