mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3213] [Issue]: Editing a stopped ("unfinished") reply deletes it on save #1727
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#1727
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 @Magiwarriorx on GitHub (Jul 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3213
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Stopping a reply mid-generation leaves an unfinished reply that renders normally, but editing it and hitting Save makes it vanish. The stopped reply is a client-only cache row with no database record, so editing it fails silently and the message is dropped on the next cache refresh.
Expected behavior
Editing a stopped reply saves the edited text and keeps the message, the same as editing any other reply.
Actual behavior
The edited message disappears on save. The edit is silently lost.
Steps to reproduce
Environment
Logs, screenshots, or video
None.
Additional context
Root cause (client), traced by source review:
`__partial_${chatId}_${Date.now()}`) and inserts it into the React Query cache only —packages/client/src/hooks/use-generate.ts:2421.use-generate.ts:2445, viaappendMissingPersistedMessagesatuse-generate.ts:480.useUpdateMessage, whichPATCHes/chats/:chatId/messages/:messageIdwith the synthetic id —packages/client/src/hooks/use-chats.ts:843. No such row exists server-side, so the request fails.onSettledinvalidates the messages query —use-chats.ts:875. The refetch reconciles the cache to the server's list (which never contained the placeholder), so the message is dropped. TheonErrorrollback atuse-chats.ts:871does not save it, because the invalidation refetch runs afterward and wins.Not verified: whether the server ever persists partial content on stop under some conditions (would change whether this reproduces every time), and whether delete/swipe on the same placeholder fail similarly (source suggests they would, but not confirmed).
Possible fix directions
__partial_id in the edit path and POST a new message instead of patching.Template check
@SpicyMarinara commented on GitHub (Jul 4, 2026):
Addressed in ready PR #3218 targeting staging.