mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1842] [Issue]: Character avatars missing in chat when connected to remote server #892
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#892
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gunterlie on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1842
Originally assigned to: @cha1latte on GitHub.
Summary
Character avatars fail to render in chat messages when connected to a remote Marinara server with Basic Auth. The browser's broken image icon appears instead. Avatars render correctly in the character library, cards, and all other catalog surfaces — only the chat transcript is affected.
Expected behavior
Character avatars appear in chat messages when connected to a remote runtime, consistent with how they render everywhere else in the app.
Actual behavior
Chat messages show the browser's broken image icon. DevTools Network shows the browser attempting to load a local macOS path (
/Users/philipp/Library/Application Support/.../uuid.png) as a URL, resulting in 404 ornet::ERR_FILE_NOT_FOUND.Expression sprites continue to work correctly because they are returned as inline base64 data URLs and require no HTTP fetch.
Root cause
Two compounding issues:
1. Stale
avatarFilePathin the database.Character records store the original upload machine's absolute path. On the remote Linux server the file is physically present at
/data/avatars/characters/<uuid>.pngand the/api/assets/avatar/<filename>endpoint returns 200 — but the DB field still points to the Mac path.2.
ChatMessage.tsxbypasses the authenticated async image pipeline.characterAvatarUrl()→avatarFileUrlFromPath()→remoteManagedAssetUrl()returnsnullfor authenticated remote targets (by design — a plain<img>can't send auth headers), then falls through tofilePathToAssetUrl()which returns the broken local path string. All other avatar surfaces useCharacterAvatarImage, which callsresolveAvatarFileUrl()asynchronously, fetches the image with Basic Auth headers, and returns ablob:URL. There are at least 11 raw<img src={avatarUrl}>sites inChatMessage.tsxthat bypass this working pattern.Steps to reproduce
Environment
refactorbranch (2026-06-01)Logs, screenshots, or video
DB record queried directly from the remote server:
The file exists on the server and the asset endpoint returns 200. The problem is entirely client-side.
Additional context
Recommended fix: Replace raw
<img src={avatarUrl}>tags inChatMessage.tsxwithCharacterAvatarImage(or an equivalent async component).avatarFilePathandavatarFilenameneed to be surfaced throughuseChatSurfaceData→characterMapso the component can callresolveAvatarFileUrl()and get a blob URL via authenticated fetch. This is already the pattern used by every other avatar surface in the app.A DB-only fix (rewriting
avatarFilePathvalues) is not sufficient — local clients will re-introduce local paths on any new avatar upload.Key files:
src/features/modes/shared/chat-ui/components/ChatMessage.tsx— all raw<img>avatar sitessrc/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts—characterMapmissingavatarFilePath/avatarFilenamesrc/features/catalog/characters/components/CharacterAvatarImage.tsx— reference implementationsrc/shared/api/local-file-api.ts— syncremoteManagedAssetUrlvs. asyncresolveAvatarFileUrlTemplate check
@cha1latte commented on GitHub (Jun 1, 2026):
Closed in #1846