mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1519] [MERGED] Enroll source chat into its group when creating the first branch #5116
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#5116
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/1519
Author: @Romuromylus
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/branch-root-chat-group📝 Commits (2)
bf14ac0Enroll source chat into its group when creating the first branche850c0bClarify branch enroll ordering and import-path parity in comment📊 Changes
1 file changed (+93 additions, -4 deletions)
View changed files
📝
src-tauri/src/commands/storage/chats.rs(+93 -4)📄 Description
Why this change
After creating Roleplay branches, Manage Chat Files worked from a branch chat but the original/root chat still reported it was not part of a group and had no branches.
branch_chatset the new branch'sgroupIdto the source chat id, but left the source/root chat atgroupId: null. The drawer and branch selector only fetch a group when the active chat has agroupId, so opening either from the original chat showed the no-group empty state even though branch records already pointed at that chat id.What changed
src-tauri/src/commands/storage/chats.rs: when the source chat has no group, enroll it into the new group (keyed on its own id) alongside the branch, mirroring the intent of the ST-chat-into-group import path that already promotes the target chat to a group root. An empty-stringgroupIdis now treated as ungrouped too. The branch is created first and the source enrolled after, on purpose: a failed enroll patch degrades to the pre-fix state rather than leaving a root in a branchless group.Verification
pnpm checkpasses locally;cargo test --lib176 passed / 0 failed, including two new regression tests: an ungrouped source chat gets enrolled and the group lists both chats, and an already-grouped source is not re-patched.cargo clippy --workspace --all-targets -- -D warningsclean.chat_branchinvoke through the real Rust runtime and real storage): branching an ungrouped roleplay chat enrolls the root, the branch joins the group, andstorage_listfiltered bygroupIdreturns both the root and the branch. Seeded chats cleaned up afterward.Known caveat
This fixes branch discovery for chats branched after the change. Chats that were already branched while the root stayed ungrouped (the existing broken state in the report) are not retroactively patched; that migration is tracked in #1522.
Follow-ups (deferred, not blocking)
Linked issue
Closes #1509
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.