mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2340] [MERGED] Fix connected chat disconnect cleanup #5543
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#5543
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/2340
Author: @Promansis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Promansis
Base:
refactor← Head:fix/issue-2306📝 Commits (1)
3d6b6c3Fix connected chat disconnect cleanup📊 Changes
6 files changed (+441 additions, -15 deletions)
View changed files
📝
src-tauri/src/commands/storage/chats.rs(+355 -0)📝
src-tauri/src/commands/storage/commands/chats.rs(+1 -4)📝
src-tauri/src/http_dispatch.rs(+74 -6)📝
src/features/catalog/chats/hooks/use-chats.ts(+7 -3)📝
src/features/shell/plugins/components/CoreModulesSettings.tsx(+3 -1)📝
src/features/shell/plugins/shell.ts(+1 -1)📄 Description
Linked issue
Closes #2306
Why this change
Connected chat disconnect only cleared the requested chat in refactor. The partner chat could keep
connectedChatId, and connected durable notes or pending influences could remain innotes, allowing stale conversation context to keep entering roleplay/game prompts after disconnect.What changed
/api/invoke.connectedChatIdon both sides of the pair, including reverse-only stale links.noteandinfluenceentries bysourceChatId/targetChatIdwhile preserving ordinary memories and unrelated notes.Refactor impact
Primary owner:
Rust storage and remote runtime dispatch.
Impact areas reviewed:
/api/invokeparity forchat_disconnectBoundary notes:
The state transition lives in
src-tauristorage ownership and is reused by the embedded command wrapper andhttp_dispatch.rs. Feature code continues using the existing shared API wrapper/hook path.Pressure points touched:
src-tauri/src/commands/storage/chats.rssrc-tauri/src/commands/storage/commands/chats.rssrc-tauri/src/http_dispatch.rssrc/features/catalog/chats/hooks/use-chats.tsValidation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
cargo test --manifest-path src-tauri/Cargo.toml disconnect_connected_chatcargo test --manifest-path src-tauri/Cargo.toml dispatch_chat_disconnect_clears_partner_and_connected_notescargo check --manifest-path src-tauri/Cargo.tomlpnpm typecheckpnpm checkFeature Discoverability
Check exactly one:
src/features/shell/discovery/because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.Reason:
Bugfix only; no new user-discoverable feature or workflow.
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
No visible UI layout change. Query invalidation is covered by typecheck and command-level storage/remote tests.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.