mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2499] [Issue]: Message creation should refresh parent chat updatedAt #1240
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#1240
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 (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2499
Summary
On the refactor branch, creating messages through the
message_swipes::create_messagepath persists the message row andmessage-swipessidecar rows, but does not refresh the owning chat'supdatedAt. LegacycreateMessagerefreshed the parent chat after inserting the message and initial swipe, so active chats and newly copied branches stayed correct in recency-ordered chat lists.Expected behavior
Creating a visible chat message should update the parent
chats.updatedAtconsistently with legacy behavior. Branch/import flows that preserve old message timestamps should explicitly choose the parent chat timestamp policy, such as preserving an import timestamp or resetting a newly created branch to now.Actual behavior
Refactor generic message creation dispatches to
message_swipes::create_message, which writesmessagesplusmessage-swipesand returns a projected timeline message. No parentchatspatch is visible in that path.branch_chatcopies messages by looping throughmessage_swipes::create_message. If no later tracker/game-state patch runs, the new branch can retain timestamps copied from the source chat becauseFileStorage::createonly insertscreatedAt/updatedAtwhen they are missing.Steps to reproduce
chatscollection.updatedAtvalue with the created message time / branch creation time and the recency order used by chat lists.Impact area
Environment
perf/issue-2493-app-speedat7e70c4dawith local storage/message-swipe changes under reviewLogs, screenshots, or video
No runtime logs or screenshots. Static parity evidence:
packages/server/src/services/storage/chats.storage.tsupdateschats.updatedAtincreateMessageafter insertingmessagesandmessage_swipes.packages/server/src/routes/chats.routes.tsbranch creation explicitly resets the new branch timestamp after copying preserved message timestamps.src-tauri/src/commands/storage/message_swipes.rscreate_messagepersists message and sidecar swipe rows without touching parent chat metadata.src-tauri/src/commands/storage/chats.rsbranch_chatloops throughmessage_swipes::create_messageand returns the new chat without a guaranteed final timestamp touch.src-tauri/crates/storage/src/lib.rsFileStorage::createpreserves suppliedcreatedAt/updatedAtvalues withor_insert, so copied chat timestamps can remain old unless the caller patches them.Regression notes
Legacy behavior refreshed parent chat recency on message create. Exact refactor last-known-good commit is unknown.
Additional context
This surfaced while checking the new message+swipe append optimization against legacy chat storage behavior. The append optimization itself appears compatible for single-message persistence; the missing parent-chat recency update is adjacent behavior.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: