mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2418] [MERGED] Normalize chat-bulk import entity defaults and message roles #5596
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#5596
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/2418
Author: @Romuromylus
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/chat-bulk-import-normalize📝 Commits (1)
f1819d1Normalize chat-bulk import entity defaults and message roles📊 Changes
2 files changed (+7 additions, -2 deletions)
View changed files
📝
src-tauri/src/commands/storage/imports/bulk_imports.rs(+1 -1)📝
src-tauri/src/commands/storage/imports/marinara_chat_bulk.rs(+6 -1)📄 Description
Linked issue
Closes #2368
Why this change
marinara-chat-bulkimporter created chat records via rawstorage.createand persisted messages without role validation, unlike every sibling import path. Stringified typed fields (e.g.characterIds) stayed strings, and arbitrary message roles persisted unchecked.What changed
src-tauri/src/commands/storage/imports/marinara_chat_bulk.rs: chat creation now routes through the sharedwith_entity_defaults("chats", ...)(seeds CHAT_DEFAULTS + normalizes CHAT_FIELDS typed JSON), mirroringmarinara.rs. Each message role is run through the existingimported_jsonl_message_roleallowlist before insert.src-tauri/src/commands/storage/imports/bulk_imports.rs: widenedimported_jsonl_message_roletopub(crate)so the sibling importer can reuse it.narrator; only truly-unknown roles coerce toassistant, so valid roles pass through unchanged.Refactor impact
Primary owner: Rust storage (imports)
Impact areas reviewed:
src-tauri/src/commands/storage/imports/marinara_chat_bulk.rs(chat + message creation)src-tauri/src/commands/storage/imports/bulk_imports.rs(helper visibility)Boundary notes:
pub(crate), no engine/features/shared crossing, no mode branching. On already-real arrayswith_entity_defaultsis a no-op, so clean exports round-trip unchanged.Pressure points touched:
Validation
pnpm checkpasses before PR push/handoffManual verification notes
cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine imports::— 62 passed (no regression). A local-only test confirmed a stringifiedcharacterIds/metadatachat normalizes to a real array/object and thatnarratoris preserved while an unknown role (banana) coerces toassistant.cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings— clean.Feature Discoverability
src/features/shell/discovery/Reason:
Docs and release impact
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.