mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2272] [Issue]: 09-CHAT-STORAGE-message-create-edit-active-swipe-sync: message create omits legacy default extra #1110
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#1110
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?
Originally created by @Promansis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2272
Originally assigned to: @Promansis on GitHub.
Summary
09-CHAT-STORAGE-message-create-edit-active-swipe-syncparityscan found a confirmed gap: refactor message creation preserves active-swipe content sync, but it does not seed the legacy defaultMessageExtraleaves on normal message create responses.Linked tracker: #2268.
Expected behavior
Legacy message create seeds both the active swipe and a default message
extraobject:displayText: nullisGenerated: input.role !== "user"tokenCount: nullgenerationInfo: nullVisible-message edits should continue syncing edited content into the active swipe so content survives swipe changes.
Actual behavior
Refactor does seed
activeSwipeIndex: 0and an initial swipe, and message edits sync into the active swipe. However, normaluseCreateMessage/storageApi.createChatMessagesends onlychatId,role,characterId, andcontent, andchatMessageDefaultsfalls back toextra: {}. The Tauri message collection contract has no create defaults for the legacyMessageExtraleaves, so saved/returned user-created messages can have{}instead of the legacy defaultextrashape.Steps to reproduce
mainmessage creation with refactor message creation for09-CHAT-STORAGE-message-create-edit-active-swipe-sync.packages/server/src/services/storage/chats.storage.tscreateMessage: it writes the defaultextrafields and creates swipe index 0.src/features/catalog/chats/hooks/use-chats.tsuseCreateMessage,src/engine/contracts/schemas/chat.schema.tscreateMessageSchema,src/shared/api/storage-api.tschatMessageDefaults, andsrc-tauri/src/commands/storage/contracts.rsmessage defaults.src-tauri/src/commands/storage/shared.rssync_message_patch_content_to_active_swipeandsrc-tauri/src/commands/storage/message_swipes.rscreate/update paths.Impact area
Environment
refactorcurrent parityscan worktree; legacy sourcemainLogs, screenshots, or video
Static proof:
main:packages/server/src/services/storage/chats.storage.ts:500creates a message;:509setsactiveSwipeIndex: 0;:510writes defaultextraleaves;:519creates initial swipe row.main:packages/server/src/services/storage/chats.storage.ts:633updates message content and:639-:645syncs the edit into the active swipe.src/features/catalog/chats/hooks/use-chats.ts:504creates messages throughuseCreateMessage;:508parsescreateMessageSchema.src/engine/contracts/schemas/chat.schema.ts:26createMessageSchemaincludeschatId,role,characterId, andcontent, but noextradefaults.src/shared/api/storage-api.ts:175chatMessageDefaultsusesextra = value.extra ?? {}and seedsactiveSwipeIndex/swipesfrom that object.src-tauri/src/commands/storage/contracts.rs:385registersmessageswithEMPTY_DEFAULTS, so Rust storage does not add the legacyextraleaves on create.src-tauri/src/commands/storage/message_swipes.rs:831creates messages through the sidecar path;src-tauri/src/commands/storage/message_swipes.rs:851patches messages;src-tauri/src/commands/storage/shared.rs:588syncs content/extra patches into the active swipe.Regression notes
Legacy
mainseeded default messageextraon create. Refactor keeps active-swipe content persistence but regressed the legacy defaultextrashape for created messages.Acceptance criteria:
extraleaves when the caller does not provide them.extravalues keep those values and do not lose swipe-scoped metadata such as attachments, prompt snapshots, generation info, or reasoning./api/invokemessage create/update behavior stay aligned.Additional context
Surface:
09-CHAT-STORAGE-message-create-edit-active-swipe-sync.Batch 4 receipt classified the prompt-snapshot swipe response shape as no gap/refactor-better and did not file an issue for that surface.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: