[PR #4644] [MERGED] Preserve Persona imports and structured metadata #6451

Closed
opened 2026-10-23 04:10:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/persona-correctness-prerequisites


📝 Commits (6)

  • 8066338 fix(personas): preserve phonetic names during import
  • 57afd68 fix(personas): keep optional media failures non-fatal
  • 29b662f fix(personas): preserve structured extension metadata
  • 4649a6f fix(personas): preserve legacy imports when avatar restore fails
  • bc2ae10 Merge branch 'staging' into fix/persona-correctness-prerequisites
  • 8ae4b73 Merge branch 'staging' into fix/persona-correctness-prerequisites

📊 Changes

5 files changed (+108 additions, -43 deletions)

View changed files

📝 packages/client/src/components/modals/ImportPersonaModal.tsx (+1 -0)
📝 packages/client/src/lib/stat-icon-assignments.ts (+15 -8)
📝 packages/server/src/routes/backup.routes.ts (+27 -14)
📝 packages/server/src/services/import/marinara.importer.ts (+61 -20)
📝 packages/shared/src/utils/rpg-stats.ts (+4 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4646
except it doesn't because this is part 1 but Github is dumb

Why this change

Persona import and editor paths reconstruct known fields independently. That can silently drop pronunciation data or nested extension metadata, while an optional media failure can incorrectly turn an otherwise successful Persona import into a failure after its row already exists.

What changed

  • Preserve Persona phonetic names across native, compatible JSON, and legacy backup imports.
  • Keep an already-created Persona when optional avatar or sprite restoration fails, while allowing each media restore to succeed independently.
  • Preserve unknown structured metadata when RPG pools and tracker stat-icon assignments are normalized or edited.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands completed:

  • pnpm --dir packages/client exec tsc --noEmit
  • git diff --check origin/staging..HEAD

Manual verification notes

Not performed. Before submitting for review:

  • Import native, compatible JSON, and legacy backup Personas with a phonetic name and confirm it survives.
  • Confirm an optional avatar or sprite restore failure retains the imported Persona row.
  • Edit an RPG pool and tracker stat icon carrying unknown metadata and confirm that metadata survives.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No documentation, translation, or release-file changes are expected for this internal correctness slice.

UI evidence (if applicable)

Not applicable; this PR does not change the visual interface.

Summary by CodeRabbit

  • New Features

    • Persona imports now preserve phonetic names from imported data.
    • Custom metadata for stat icons and RPG health pools is retained during updates and synchronization.
  • Bug Fixes

    • Improved persona asset importing so invalid avatars or sprites no longer prevent the persona from being imported.
    • Added safer handling for malformed asset data, including cleanup of unusable files.
    • Legacy persona imports now restore avatars more reliably while retaining phonetic names.

🔄 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/4644 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 8/5/2026 **Status:** ✅ Merged **Merged:** 8/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/persona-correctness-prerequisites` --- ### 📝 Commits (6) - [`8066338`](https://github.com/Pasta-Devs/Marinara-Engine/commit/80663383c851bad4fc3076120b0e00a2aba9d574) fix(personas): preserve phonetic names during import - [`57afd68`](https://github.com/Pasta-Devs/Marinara-Engine/commit/57afd68f7ad5f90fa427b4acd813750fb5033565) fix(personas): keep optional media failures non-fatal - [`29b662f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/29b662f38c63f4de83e227a6323cbec8c1704681) fix(personas): preserve structured extension metadata - [`4649a6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4649a6f7551895862f3e6c9a19d3a421c2466ad3) fix(personas): preserve legacy imports when avatar restore fails - [`bc2ae10`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc2ae10142defcc413ad9dd2991ab2f821f4700d) Merge branch 'staging' into fix/persona-correctness-prerequisites - [`8ae4b73`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ae4b736f88721698b0b578d049b8ed84e4dc686) Merge branch 'staging' into fix/persona-correctness-prerequisites ### 📊 Changes **5 files changed** (+108 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/modals/ImportPersonaModal.tsx` (+1 -0) 📝 `packages/client/src/lib/stat-icon-assignments.ts` (+15 -8) 📝 `packages/server/src/routes/backup.routes.ts` (+27 -14) 📝 `packages/server/src/services/import/marinara.importer.ts` (+61 -20) 📝 `packages/shared/src/utils/rpg-stats.ts` (+4 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #4646 except it doesn't because this is part 1 but Github is dumb ## Why this change Persona import and editor paths reconstruct known fields independently. That can silently drop pronunciation data or nested extension metadata, while an optional media failure can incorrectly turn an otherwise successful Persona import into a failure after its row already exists. ## What changed - Preserve Persona phonetic names across native, compatible JSON, and legacy backup imports. - Keep an already-created Persona when optional avatar or sprite restoration fails, while allowing each media restore to succeed independently. - Preserve unknown structured metadata when RPG pools and tracker stat-icon assignments are normalized or edited. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Commands completed: - `pnpm --dir packages/client exec tsc --noEmit` - `git diff --check origin/staging..HEAD` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> Not performed. Before submitting for review: - Import native, compatible JSON, and legacy backup Personas with a phonetic name and confirm it survives. - Confirm an optional avatar or sprite restore failure retains the imported Persona row. - Edit an RPG pool and tracker stat icon carrying unknown metadata and confirm that metadata survives. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No documentation, translation, or release-file changes are expected for this internal correctness slice. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Not applicable; this PR does not change the visual interface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Persona imports now preserve phonetic names from imported data. - Custom metadata for stat icons and RPG health pools is retained during updates and synchronization. - **Bug Fixes** - Improved persona asset importing so invalid avatars or sprites no longer prevent the persona from being imported. - Added safer handling for malformed asset data, including cleanup of unusable files. - Legacy persona imports now restore avatars more reliably while retaining phonetic names. <!-- 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-23 04:10:34 +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#6451
No description provided.