fix(clone): stall-based git clone timeout + live progress in New Project / Clone dialog#161
Merged
Conversation
…ion + live progress git_clone_repo killed healthy slow clones at a hard 120s cap — on a slow connection a big repo reliably failed with 'git clone timed out after 120 seconds'. The clone now runs `git clone --progress`, streams stderr, and only fails when NO output arrives for 120 consecutive seconds (a genuinely wedged transfer). A slow-but-progressing clone can run as long as it needs. - backend: stall-based timeout, kill_on_drop, GIT_TERMINAL_PROMPT=0 (fail fast instead of hanging on hidden auth prompts), partial-clone cleanup on stall-kill (only if the target dir didn't pre-exist), git-clone-progress Tauri events (phase/percent/detail, throttled), pure parse_clone_progress parser + unit tests - frontend: useCloneProgress hook (tilde-aware targetDir matching + tests) and CloneProgressRow (phase, percent, determinate bar, throughput detail) wired into the New Project screen and Clone dialog, with reassurance copy while cloning - dev mock: git_clone_repo handler streams realistic progress events so the flow is demoable in npm run dev - docs: workspace-creation.md clone-flow behavior notes
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.
Problem
Cloning a repo from the New Project → Clone screen failed with
git clone timed out after 120 secondson slow connections.git_clone_repowrapped the clone in a hard absolute 120s timeout, so any healthy-but-slow clone (big repo, weak wifi) was killed mid-transfer. Meanwhile the UI showed only a bare "Cloning..." spinner — no signal that anything was happening.Fix
Backend (
src-tauri/src/commands/git.rs)git clone --progresswith piped stderr and stream it (split on both\rand\n— git delimits in-place progress with carriage returns)git-clone-progressTauri events{ targetDir, phase, percent, detail }, throttled to phase/percent changes; pureparse_clone_progressparser with unit testsGIT_TERMINAL_PROMPT=0so auth-required URLs fail fast instead of hanging on a hidden prompt;kill_on_drop; on stall-kill, remove the partial clone dir only if it didn't pre-existFrontend
useCloneProgresshook (tilde-awaretargetDirmatching — the backend expands~before echoing it back — with unit tests) +CloneProgressRowcomponent: phase label, percent, determinate progress bar (pulse while indeterminate), throughput detail line — design tokens onlynpm run devScreenshot
Mid-clone in the New Project screen (dev mock):
Verification
cargo test --manifest-path src-tauri/Cargo.toml --lib commands::git— 14 passed (9 new parser tests)npm run check— cleannpm run test— 171 files / 2482 tests passed (5 newmatchesCloneTargettests)~/projects/location; progress bar, phases, and MiB/s detail render live (screenshot above)