mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4196] [Issue]: First sent-message edit appears to revert after stopping generation #2272
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#2272
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 @Xelvanis on GitHub (Jul 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4196
Originally assigned to: @SpicyMarinara on GitHub.
Summary
After sending a message and stopping generation before the response finishes, editing that sent user message appears to revert on the first save attempt. Editing the same message a second time succeeds.
Static investigation strongly indicates this is the same client-side cache race reported in #4115, rather than a failure in the server-side message update.
Expected behavior
The edited text should be shown and remain saved on the first attempt, including immediately after a generation is stopped or fails.
Actual behavior
The first edit appears not to persist. Repeating the edit after generation cleanup has settled saves and displays the new text correctly. Clearing leftover text from the chat composer beforehand does not change the behavior.
Steps to reproduce
Environment
.exe)Logs, screenshots, or video
The reporter supplied a screenshot of the original report. No logs or browser network trace were provided.
Root cause investigation
Static comparison of v2.3.4 with current
stagingstrongly indicates a race between message-edit cache handling and generation cleanup:useUpdateMessage().useUpdateMessage().onMutatefirst awaits cancellation of the in-flight messages query.The server path does not have the same ordering problem:
PATCH /api/chats/:chatId/messages/:messageIddirectly updates the message content and synchronizes the active swipe. This makes a client-side stale-cache overwrite the more likely explanation.Likely fix and current status
Current
stagingalready changes the mutation ordering inpackages/client/src/hooks/use-chats.ts:{ revert: false }.The ordering fix landed in commit
5d849e4fcand is present in currentorigin/staging. Merged PR #4122 added regression guards for this behavior while resolving the closely matching #4115.This report is therefore likely already fixed on
stagingbut remains reproducible in the 2.3.4 release. Before closing it as a duplicate/resolved issue, manually verify the exact stop-generation sequence on a current staging build:PATCHresponse and the following messagesGETresponse to distinguish a persistence failure from a display-cache rollback.Additional context
Related issue: #4115 — user reply edits in Roleplay mode fail while an assistant response is generating.
The original report described the title as occurring after a generation failure, while its reproduction specifically uses Stop Generation. Both paths converge on the same generation cleanup and message-refresh lifecycle.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 28, 2026):
Regression verification is claimed by @SpicyMarinara on
agent/assigned-issues-4195-4198. I’m verifying the exact stop-generation/first-edit sequence against the current staging cache fix and will attach the shared draft PR here once the proof guard is pushed.@SpicyMarinara commented on GitHub (Jul 28, 2026):
Draft regression-verification PR: #4199
@SpicyMarinara commented on GitHub (Jul 28, 2026):
Verified and guarded on
stagingvia #4199 (a97cc55d6). The stop-generation path now has exact browser coverage for the first saved edit with retained and cleared composer drafts, followed by reload persistence. The existing staging cache behavior remains intact.