Skip to content

fix(remote): delete workspace directories in one target command - #3720

Merged
bobleer merged 3 commits into
openBitFun:mainfrom
bobleer:bob/remote-directory-delete
Nov 3, 2026
Merged

bobleer merged 3 commits into
openBitFun:mainfrom
bobleer:bob/remote-directory-delete

Conversation

@bobleer

@bobleer bobleer commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Deleting a remote directory currently enumerates its children and awaits each SFTP removal or Docker/WSL command separately. Delete the entire directory with one command on the effective workspace target, preserving literal filenames, no-follow symlink behavior, and command failure reporting.

Recursive deletion also opts out of the Web UI's generic 30-second deadline so the UI can receive the actual result. Existing peer RPC and connection deadlines remain in force.

The legacy remote_remove command now honors recursive=false: it checks no-follow metadata and only removes empty directories, instead of accidentally dispatching recursive deletion. Metadata failures remain errors and directory symlinks are unlinked as files.

Type and Areas

Type: bug fix / performance

Areas: shared remote workspace filesystem service, SSH/Docker/WSL adapters, Web UI file operations.

Motivation / Impact

A directory with 500 files across 10 subdirectories now requires one SSH exec and zero SFTP requests instead of a network round trip per child. The same shared service serves Desktop, CLI peer hosts, and mobile HostInvoke callers. Root/invalid paths are rejected, symbolic links are unlinked without traversing their targets, and failed or unsupported command execution is surfaced instead of falling back to per-file deletion.

Verification

  • GitHub Actions CI — passed for 9f4ca4de56146385f2d045f9f0de552639b3d8c2, including Linux/macOS/Windows Rust and CLI, frontend, and the final validation gate. Repository Object Sizes also passed.
  • cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-ssh-concrete --lib recursive_directory_delete — 3 passed.
  • cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-ssh-concrete --lib remote_ssh::manager::tests::workspace_sftp:: — 15 passed; 4 existing opt-in tests ignored.
  • OPENBITFUN_TEST_SFTP_SERVER=/usr/libexec/sftp-server cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-ssh-concrete --lib directory_symlink_browsing -- --include-ignored — 2 passed, including real OpenSSH SFTP over loopback SSH.
  • pnpm --dir src/web-ui run test:run src/infrastructure/api/service-api/ApiClient.test.ts src/infrastructure/api/service-api/WorkspaceAPI.test.ts — 31 passed; fake-clock regressions keep deletion pending beyond 30 seconds until the transport completes.
  • pnpm run check:web — passed, including type checking and existing Appearance/theme gates.
  • cargo check --locked -p openbitfun-desktop — passed after the legacy non-recursive removal fix.
  • pnpm run fmt:rs and git diff --check — passed.

Reviewer Notes

AI-assisted; tested with focused transport/service and frontend tests plus the Web UI checks. Remote verification covers loopback SSH and the production Docker command adapter against a local POSIX shell fixture. Physical Docker/WSL, multi-device Peer Mode, mobile Remote Control, and Detached Dispatch were not exercised end to end.

Remote recursive deletion requires target-side POSIX shell execution. No new wire commands, capability fields, or persisted shapes are introduced. Peer transport deadlines are unchanged.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 673a3cc into openBitFun:main Nov 3, 2026
13 checks passed
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.

1 participant