[PR #1982] [MERGED] Fix native character avatar import storage #5372

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1982
Author: @cha1latte
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1960-native-avatar-import


📝 Commits (4)

  • 59d0304 Fix native character avatar import storage
  • d2bf8d1 Fix native avatar import clippy warnings
  • 3a9eef4 Preserve plain native character avatars
  • 6d0d35d Use literal native avatar test data

📊 Changes

2 files changed (+192 additions, -11 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/marinara.rs (+51 -11)
📝 src-tauri/src/commands/storage/imports/marinara_tests.rs (+141 -0)

📄 Description

Linked issue

Closes #1960

Why this change

  • Native .marinara character imports with embedded avatars were storing the data:image/... payload directly in character avatar fields. That diverged from legacy native import behavior and from the current ST/CharX managed avatar import path.

What changed

  • Native Marinara character import now adapts embedded avatar data through the same managed character avatar helper used by ST/CharX import.
  • Both ST-shaped native character envelopes and storage-record-shaped native character envelopes now set avatarPath, avatarFilePath, and avatarFilename from managed avatar storage instead of persisting inline avatar bytes.
  • Native character import rollback now removes the managed avatar file if a later import step fails after avatar persistence.
  • Added Rust regressions for both native character envelope shapes and the rollback path.

Refactor impact

Primary owner:

Rust storage imports.

Impact areas reviewed:

  • Native Marinara character import
  • Managed character avatar storage metadata
  • Native import rollback for post-avatar failures
  • Existing ST/CharX avatar import helper reuse

Boundary notes:

  • Change stays inside src-tauri storage import code.
  • No React, engine, shared API, remote-runtime, schema, dependency, or command registration changes.

Pressure points touched:

  • src-tauri/src/commands/storage/imports/marinara.rs
  • src-tauri/src/commands/storage/imports/marinara_tests.rs

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran cargo test --manifest-path src-tauri/Cargo.toml native_marinara_ -- --nocapture: passed. The tests cover ST-shaped native character avatar materialization, storage-record-shaped native character avatar materialization, and rollback when a later sprite import step fails.
  • Codex ran cargo check --manifest-path src-tauri/Cargo.toml --workspace: passed.
  • Codex ran rustfmt --check src-tauri/src/commands/storage/imports/marinara.rs src-tauri/src/commands/storage/imports/marinara_tests.rs: passed.
  • Codex ran git diff --check: passed.
  • Full cargo fmt --manifest-path src-tauri/Cargo.toml --check currently reports unrelated pre-existing rustfmt drift outside this PR's files.
  • Codex ran pnpm check: passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • This is a storage/import bugfix for existing native Marinara character imports; it does not add a new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. This is a Rust storage import bugfix with command-level regression coverage; no visible UI surface changed.


🔄 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/1982 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1960-native-avatar-import` --- ### 📝 Commits (4) - [`59d0304`](https://github.com/Pasta-Devs/Marinara-Engine/commit/59d03049d6699d8020c942db4d1cb32ba06fa981) Fix native character avatar import storage - [`d2bf8d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2bf8d19fedf719f72febb307478bc883817c773) Fix native avatar import clippy warnings - [`3a9eef4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3a9eef495f6b7e4529a942ad7dccf741e01f910b) Preserve plain native character avatars - [`6d0d35d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d0d35db9e37eeed2f349c6b9bc75f82d2b3177b) Use literal native avatar test data ### 📊 Changes **2 files changed** (+192 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/marinara.rs` (+51 -11) 📝 `src-tauri/src/commands/storage/imports/marinara_tests.rs` (+141 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1960 ## Why this change - Native `.marinara` character imports with embedded avatars were storing the `data:image/...` payload directly in character avatar fields. That diverged from legacy native import behavior and from the current ST/CharX managed avatar import path. ## What changed - Native Marinara character import now adapts embedded avatar data through the same managed character avatar helper used by ST/CharX import. - Both ST-shaped native character envelopes and storage-record-shaped native character envelopes now set `avatarPath`, `avatarFilePath`, and `avatarFilename` from managed avatar storage instead of persisting inline avatar bytes. - Native character import rollback now removes the managed avatar file if a later import step fails after avatar persistence. - Added Rust regressions for both native character envelope shapes and the rollback path. ## Refactor impact Primary owner: Rust storage imports. Impact areas reviewed: - Native Marinara character import - Managed character avatar storage metadata - Native import rollback for post-avatar failures - Existing ST/CharX avatar import helper reuse Boundary notes: - Change stays inside `src-tauri` storage import code. - No React, engine, shared API, remote-runtime, schema, dependency, or command registration changes. Pressure points touched: - `src-tauri/src/commands/storage/imports/marinara.rs` - `src-tauri/src/commands/storage/imports/marinara_tests.rs` ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `cargo test --manifest-path src-tauri/Cargo.toml native_marinara_ -- --nocapture`: passed. The tests cover ST-shaped native character avatar materialization, storage-record-shaped native character avatar materialization, and rollback when a later sprite import step fails. - Codex ran `cargo check --manifest-path src-tauri/Cargo.toml --workspace`: passed. - Codex ran `rustfmt --check src-tauri/src/commands/storage/imports/marinara.rs src-tauri/src/commands/storage/imports/marinara_tests.rs`: passed. - Codex ran `git diff --check`: passed. - Full `cargo fmt --manifest-path src-tauri/Cargo.toml --check` currently reports unrelated pre-existing rustfmt drift outside this PR's files. - Codex ran `pnpm check`: passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - This is a storage/import bugfix for existing native Marinara character imports; it does not add a new discoverable feature. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. This is a Rust storage import bugfix with command-level regression coverage; no visible UI surface changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:42 +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#5372
No description provided.