[GH-ISSUE #2174] [Issue]: Native persona import keeps embedded avatars inline #1081

Closed
opened 2026-10-21 05:26:27 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2174

Originally assigned to: @Promansis on GitHub.

Summary

Native Marinara persona import restores persona avatar data by copying the exported data:image/... string directly into the persona record's avatarPath/avatar fields instead of materializing a managed avatar file. Legacy imported the same native persona avatar through validated image bytes and stored a managed avatar path.

Expected behavior

Importing a native marinara_persona export with embedded avatar data should create a managed persona avatar file, store the managed asset URL/metadata on the persona row, and roll back that file if the import fails after creation.

Actual behavior

import_marinara_persona removes reserved fields, builds the persona row, then inserts the exported avatar string directly into avatarPath and avatar. No managed avatar file is created for native persona imports, so this path bypasses the managed asset layout used by normal persona avatar upload and legacy native import.

Steps to reproduce

  1. On refactor at 7d4f39f4, inspect src-tauri/src/commands/storage/imports/marinara.rs around import_marinara_persona.
  2. Compare legacy main at 77a30fa4, packages/server/src/services/import/marinara.importer.ts, where importPersona calls saveAvatarFromDataUrl and updates the persona avatar path after creating the row.
  3. Import a native persona export with an embedded avatar data URL and inspect the stored persona row.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor 7d4f39f4; legacy comparison main 77a30fa4
  • Run mode: Tauri desktop / remote runtime asset behavior may both be affected
  • OS + version: not checked
  • Node + pnpm versions: not checked
  • Rust version, if relevant: not checked
  • Remote Runtime URL configured? not relevant to static trace
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Static trace evidence:

  • Refactor: src-tauri/src/commands/storage/imports/marinara.rs:400 defines import_marinara_persona; :406 inserts exported avatar directly into avatarPath/avatar; :416 restores persona sprites only.
  • Refactor: src-tauri/src/commands/storage/imports/marinara_assets.rs:47 has persona sprite restoration, but no matching persona avatar materialization helper.
  • Legacy: packages/server/src/services/import/marinara.importer.ts:47 saveAvatarFromDataUrl; :334 imports persona avatar data; :336 updates the persona avatar path.

Focused check run during parityscan: cargo test --manifest-path src-tauri/Cargo.toml persona passed 16 tests, but it does not include a native persona import/export avatar round-trip.

Regression notes

This is a parity gap against legacy native persona import. Legacy wrote embedded native persona avatars into managed avatar storage; refactor keeps the embedded data URL inline on the row.

Additional context

Found while refreshing issue #2133 row 06-PER-COMPAT-native-import-avatar-sprites.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2174 Originally assigned to: @Promansis on GitHub. ## Summary Native Marinara persona import restores persona avatar data by copying the exported `data:image/...` string directly into the persona record's `avatarPath`/`avatar` fields instead of materializing a managed avatar file. Legacy imported the same native persona avatar through validated image bytes and stored a managed avatar path. ## Expected behavior Importing a native `marinara_persona` export with embedded avatar data should create a managed persona avatar file, store the managed asset URL/metadata on the persona row, and roll back that file if the import fails after creation. ## Actual behavior `import_marinara_persona` removes reserved fields, builds the persona row, then inserts the exported `avatar` string directly into `avatarPath` and `avatar`. No managed avatar file is created for native persona imports, so this path bypasses the managed asset layout used by normal persona avatar upload and legacy native import. ## Steps to reproduce 1. On `refactor` at `7d4f39f4`, inspect `src-tauri/src/commands/storage/imports/marinara.rs` around `import_marinara_persona`. 2. Compare legacy `main` at `77a30fa4`, `packages/server/src/services/import/marinara.importer.ts`, where `importPersona` calls `saveAvatarFromDataUrl` and updates the persona avatar path after creating the row. 3. Import a native persona export with an embedded avatar data URL and inspect the stored persona row. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` `7d4f39f4`; legacy comparison `main` `77a30fa4` - Run mode: Tauri desktop / remote runtime asset behavior may both be affected - OS + version: not checked - Node + pnpm versions: not checked - Rust version, if relevant: not checked - Remote Runtime URL configured? not relevant to static trace - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Static trace evidence: - Refactor: `src-tauri/src/commands/storage/imports/marinara.rs:400` defines `import_marinara_persona`; `:406` inserts exported `avatar` directly into `avatarPath`/`avatar`; `:416` restores persona sprites only. - Refactor: `src-tauri/src/commands/storage/imports/marinara_assets.rs:47` has persona sprite restoration, but no matching persona avatar materialization helper. - Legacy: `packages/server/src/services/import/marinara.importer.ts:47` `saveAvatarFromDataUrl`; `:334` imports persona avatar data; `:336` updates the persona avatar path. Focused check run during parityscan: `cargo test --manifest-path src-tauri/Cargo.toml persona` passed 16 tests, but it does not include a native persona import/export avatar round-trip. ## Regression notes This is a parity gap against legacy native persona import. Legacy wrote embedded native persona avatars into managed avatar storage; refactor keeps the embedded data URL inline on the row. ## Additional context Found while refreshing issue #2133 row `06-PER-COMPAT-native-import-avatar-sprites`. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:26:27 +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#1081
No description provided.