Skip to content

fix(projects): complete safe grouped project deletion - #1371

Merged
vastsa merged 2 commits into
mainfrom
codex/fix-pr1369-group-removal
Oct 4, 2026
Merged

vastsa merged 2 commits into
mainfrom
codex/fix-pr1369-group-removal

Conversation

@vastsa

@vastsa vastsa commented Oct 4, 2026

Copy link
Copy Markdown
Owner

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.update can detach a non-primary root with chats and preserve those chats as a standalone project, but it cannot remove the primary. projects.remove now 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 -- --check passed.
  • Targeted grouped-root deletion and active-session RPC tests passed.
  • cargo test -p host-core --locked passed (751 tests).
  • cargo clippy --workspace --all-targets --all-features passed.
  • pnpm check:pr-base passed; origin/main is an ancestor of this head.
  • Full Desktop E2E was not run: no host-backed project-removal E2E exists. The new RPC regression exercises handle_request; the corresponding UI scenario is documented as Draft.

Supersedes #1369. Fixes #1358.

yexisu and others added 2 commits October 4, 2026 10:27
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.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit 7e5eae6 into main Oct 4, 2026
4 checks passed
@vastsa
vastsa deleted the codex/fix-pr1369-group-removal branch October 6, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 多文件夹项目组:删除项目与移出文件夹两条守卫互相锁死,带会话的文件夹删不掉

3 participants