[PR #1657] [MERGED] Fix persona avatar path normalization #5188

Closed
opened 2026-10-22 04:14:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1657
Author: @Xelvanis
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/avatar-path-panel-crash


📝 Commits (2)

  • 2034f8d Fix persona avatar path normalization
  • f5a2b55 Address persona cache invalidation review

📊 Changes

4 files changed (+254 additions, -30 deletions)

View changed files

📝 src/features/catalog/personas/hooks/use-personas.test.tsx (+194 -8)
📝 src/features/catalog/personas/hooks/use-personas.ts (+47 -22)
📝 src/features/catalog/personas/index.ts (+1 -0)
➕ src/features/catalog/personas/lib/persona-avatar-url.ts (+12 -0)

📄 Description

Summary

  • Normalize persona avatar records through the catalog/personas hook layer.
  • Prefer managed avatar file fields (avatarFilePath/avatarFilename) when constructing UI-safe avatar URLs.
  • Cover summary, list, detail, active-persona, and update-cache paths with targeted tests.

Root Cause

Panels consuming persona records could receive raw avatarPath payloads even when the row also had managed avatar file fields. That left some UI paths rendering the heavy or unsafe avatar payload directly instead of the managed file URL, which could crash panels using avatarPath.

Validation

  • pnpm test -- src/features/catalog/personas/hooks/use-personas.test.tsx src/shared/api/local-file-api.test.ts
  • pnpm typecheck
  • pnpm check:architecture
  • pnpm build

Notes

  • No changelog update: this repo does not currently have a CHANGELOG.md file.
  • Native Tauri panel click-through with real profile data is still a useful manual QA follow-up.

Summary by CodeRabbit

  • Bug Fixes
    • Avatar paths for personas are now consistently normalized across queries and updates, ensuring reliable avatar display.

Review Change Stack


🔄 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/Pasta-Devs/Marinara-Engine/pull/1657 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/avatar-path-panel-crash` --- ### 📝 Commits (2) - [`2034f8d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2034f8db96bc3c2ed6759b69c75be58d60cbbeae) Fix persona avatar path normalization - [`f5a2b55`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f5a2b5521fa68d007aaf4074b654aed29e548f07) Address persona cache invalidation review ### 📊 Changes **4 files changed** (+254 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/personas/hooks/use-personas.test.tsx` (+194 -8) 📝 `src/features/catalog/personas/hooks/use-personas.ts` (+47 -22) 📝 `src/features/catalog/personas/index.ts` (+1 -0) ➕ `src/features/catalog/personas/lib/persona-avatar-url.ts` (+12 -0) </details> ### 📄 Description ## Summary - Normalize persona avatar records through the catalog/personas hook layer. - Prefer managed avatar file fields (`avatarFilePath`/`avatarFilename`) when constructing UI-safe avatar URLs. - Cover summary, list, detail, active-persona, and update-cache paths with targeted tests. ## Root Cause Panels consuming persona records could receive raw `avatarPath` payloads even when the row also had managed avatar file fields. That left some UI paths rendering the heavy or unsafe avatar payload directly instead of the managed file URL, which could crash panels using `avatarPath`. ## Validation - `pnpm test -- src/features/catalog/personas/hooks/use-personas.test.tsx src/shared/api/local-file-api.test.ts` - `pnpm typecheck` - `pnpm check:architecture` - `pnpm build` ## Notes - No changelog update: this repo does not currently have a `CHANGELOG.md` file. - Native Tauri panel click-through with real profile data is still a useful manual QA follow-up. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Avatar paths for personas are now consistently normalized across queries and updates, ensuring reliable avatar display. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1657?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5188
No description provided.