Repository navigation
fix(projects): complete safe grouped project deletion - #1371
Merged
Merged
Conversation
Deleting a project that sat in a multi-folder group failed with "remove the folder from the group first", while the group editor refused to detach any folder that still had chats: with both guards in play a folder with sessions could never be deleted or detached (#1358). projects.remove now detaches the path from its group as part of the delete via a new db-layer remove_project_from_group, which skips the group editor's session guard (the caller bulk-deletes those chats right after) and may remove the primary, promoting the first remaining root. Removing the last root deletes the group record. Legacy groups are left untouched. Validated: cargo fmt --check clean; host-core cargo test requires a local MSVC linker and is left to CI, with a db-level regression covering primary promotion, non-primary removal, last-root deletion, and chat reachability.
Preflight live sessions before mutating root membership, so a rejected delete does not detach the project. Update the contract and regression coverage for the new group-removal flow.
This was referenced Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follow-up carries yexisu's original #1369 commit and completes its landing fixes while preserving the original commit author.
The issue is real for the fixed primary root:
project.group.updatecan detach a non-primary root with chats and preserve those chats as a standalone project, but it cannot remove the primary.projects.removenow removes that root as part of deleting its sessions. This follow-up also checks for running sessions before changing group membership, updates the old tests that expected grouped roots to be undeletable, and synchronizes the host/UI/E2E contracts.Validation:
cargo fmt --all -- --checkpassed.cargo test -p host-core --lockedpassed (751 tests).cargo clippy --workspace --all-targets --all-featurespassed.pnpm check:pr-basepassed;origin/mainis an ancestor of this head.handle_request; the corresponding UI scenario is documented as Draft.Supersedes #1369. Fixes #1358.