mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1658] [MERGED] Fix character avatar path normalization #5189
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#5189
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1658
Author: @Xelvanis
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Xelvanis
Base:
refactor← Head:fix/avatar-path-panel-crash📝 Commits (1)
60582feFix character avatar path normalization📊 Changes
8 files changed (+708 additions, -29 deletions)
View changed files
📝
src-tauri/Cargo.lock(+1 -0)📝
src-tauri/Cargo.toml(+1 -0)📝
src-tauri/src/commands/storage/commands/profile.rs(+344 -7)📝
src-tauri/src/http_dispatch.rs(+42 -5)📝
src/features/catalog/characters/hooks/use-characters.test.ts(+253 -8)📝
src/features/catalog/characters/hooks/use-characters.ts(+43 -8)📝
src/features/catalog/personas/hooks/use-personas.test.tsx(+21 -0)📝
src/features/catalog/personas/hooks/use-personas.ts(+3 -1)📄 Description
Summary
avatarPathin character list projections so legacy inline-only avatars are still available to panels, while managed avatars continue to preferavatarFilePath/avatarFilename.avatarPath: nullwhen no avatar fields are present.load_url_binaryin both desktop Tauri and remote-runtime dispatch paths, while restricting local binary reads to managed media roots and reading through a no-follow file handle.Root Cause
The persona fix normalized avatar data at the persona hook boundary, but character hooks could still return either a missing
avatarPathfor projected managed-avatar rows or the raw embedded avatar payload from detail/by-id reads. Panels that directly usedcharacter.avatarPathcould still render the unsafe payload or miss the managed URL.The first character-list patch also omitted
avatarPathfrom the list projection. That kept managed avatars small, but it meant legacy inline-only character rows had no display avatar in list consumers. The list projection now requestsavatarPath; the existing storage projection keeps legacyavatarPathwhile omitting redundant managed embedded payloads when managed avatar file fields are present.After character avatar paths were normalized, workflows that convert the current avatar URL into a data URL, such as avatar generation references and import-as-persona paths, could receive managed local asset URLs. The existing binary loader only supported remote HTTP(S) URLs, and the remote runtime dispatcher still bypassed the new local loader, so those local managed assets still failed until
load_url_binaryshared one implementation across desktop and remote dispatch.Validation
cargo test --manifest-path src-tauri/Cargo.toml local_asset_binary --libcargo test --manifest-path src-tauri/Cargo.toml dispatch_load_url_binary --libcargo check --manifest-path src-tauri/Cargo.tomlpnpm test -- src/features/catalog/characters/hooks/use-characters.test.ts src/features/catalog/personas/hooks/use-personas.test.tsxpnpm test -- src/features/catalog/characters/hooks/use-characters.test.ts src/features/catalog/personas/hooks/use-personas.test.tsx src/shared/lib/url-blob.test.ts src/shared/api/url-binary-api.test.tspnpm typecheckpnpm check:architecturepnpm buildNotes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.