mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #772] [CLOSED] Prevent inconsistent connected chat state #4768
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#4768
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/772
Author: @aidanbrocklebank
Created: 5/13/2026
Status: ❌ Closed
Base:
staging← Head:aidanbrocklebank/583-fix-inconsistent-connected-chat-state📝 Commits (10+)
99de5c2First pass at logic fixad60a3cImprove comments3b1d155Allow manual repair4d8277cEnsure severed connections are never made in the first place1c18f65Merge branch 'main' into aidanbrocklebank/583-fix-inconsistent-connected-chat-state786354fAdd backwards compatibility for legacy scenes3df2c0fCoderabbit suggestion0262fefWrap DB updates in a transactionc538b4dImplement suggestions from Promansisbed46b4Fix typo📊 Changes
4 files changed (+73 additions, -28 deletions)
View changed files
📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+14 -8)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+6 -2)📝
packages/server/src/routes/scene.routes.ts(+7 -6)📝
packages/server/src/services/storage/chats.storage.ts(+46 -12)📄 Description
Linked issue
Closes #773
References #583
Why this change
What changed
Change to
chats.storage.tsThis PR prevents chat connections from accidentally ending up in an inconsistent state. That is, the function
connectChatsnow first callsdisconnectChaton both of the given chats, so we don't end up with any one-way connections. ThedisconnectChatfunction is also adjusted to ensure it never accidentally creates an unreciprocated connection by deleting only one side.Note that
connectChatsnow also wipes notes and OOC influences for both sides, before creating the new link.Change to
ChatRoleplaySurface.tsxandscene.routes.tsTo prevent scenes from (trying to) create such a severed relationship between the conversation that created the scene, and the original RP chat it was connected to, I've adjusted the scene RP chat to use
chatMeta.sceneOriginChatIdinstead ofchat.connectedChatIdto identify the linked conversation. This preserves the UI functionality for the scene (e.g. the switcher button in the scene takes you to the conversation) while fixing it for the conversation (e.g. the convo doesn't lose it's switcher button pointing to the original RP chat).Change in
ChatSettingsDrawer.tsxThis change allows users to manually fix any chat connections which had become inconsistent, by showing the RP chat which points at the current conversation as a valid target for said conversation's connection.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Docs and release impact
UI evidence (if applicable)
Summary by CodeRabbit
Bug Fixes
New Features
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.