Repository navigation
fix(remote): delete workspace directories in one target command - #3720
Merged
Merged
Conversation
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.
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_removecommand now honorsrecursive=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
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:rsandgit 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