Skip to content

[Issue]: Enforce chat settings profile mode and branch boundaries #4849

Description

@Xelvanis

Summary

Chat settings profiles can currently be applied to a chat in a different mode, and reusable profiles can capture branch display/lineage metadata. This lets an imported or directly requested profile mutate an incompatible chat and lets profile reuse transfer false branch identity between chats.

Expected behavior

  • Importing a profile for another chat mode stores it without applying it to the open chat.
  • Direct profile application rejects a profile/chat mode mismatch before any chat write.
  • Saving, importing, duplicating, and applying profiles cannot transfer branchName, branchParentChatId, branchParentMessageId, or branchMessageId.
  • Applying a profile preserves the target chat's own legitimate branch identity.

Actual behavior

The client immediately applies a successfully imported profile without checking its mode. The server's apply route/storage path also does not compare the profile mode with the target chat mode. The profile metadata exclusion list omits the four branch identity fields, so they can be captured and replayed onto unrelated chats.

Steps to reproduce

  1. Export a Roleplay settings profile, then import it from a Conversation chat's settings drawer.
  2. Observe that the new profile is stored and immediately applied to the Conversation chat.
  3. Alternatively, call POST /api/chat-presets/:profileId/apply/:chatId using a profile and chat with different modes; the request succeeds and writes the chat.
  4. Save a profile from a branch chat, then apply it to another chat; branch display/lineage metadata can be transferred.

Environment

  • Marinara Engine version: 2.4.2 (staging)
  • Install type: source
  • OS + version: N/A (contract/storage issue)
  • Browser or app shell: N/A

Logs, screenshots, or video

No runtime log is required. The behavior is visible in the current client import callback and server profile application/storage paths.

Additional context

The ordinary profile picker is filtered by the live chat mode, but imports bypass that filter. Legacy visual_novel data should continue to be migrated to Roleplay rather than treated as a separate compatibility mode.

Template check

  • I DID NOT read this template and provide the requested details.

Metadata

Metadata

Assignees

Labels

fixed-in-stagingAlready fixed in staging and is pending closure when staging is merged to main

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions