Skip to content

fix(sftp): settle direct folder downloads after pause and resume - #3291

Open
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-folder-download-status
Open

fix(sftp): settle direct folder downloads after pause and resume#3291
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-folder-download-status

Conversation

@binaricat

Copy link
Copy Markdown
Owner

Summary

Direct SFTP folder downloads could show Queued while files were transferring. Once paused, resuming could attempt a second directory walk, conflict with the original children, or remain Transferring at 100% after all files reached disk. Use the shared transfer runtime for this entry point and release paused children even after their completed history rows have been compacted.

Type of Change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation update
  • Build / CI change
  • Other

Related Issue (optional)

Found during smoke testing of changes since v1.1.82, including #3226 and #3287. No separate issue.

Changes Made

  • Register direct downloads as live runtime walks, keep directory status active, and publish final state through the runtime before mirroring it to the panel.
  • Keep paused descendant IDs independent of retained UI rows so resume wakes workers whose completed rows were already compacted.
  • Derive folder completion counts from the checkpoint and retained children instead of counting a background-completed file again when its invocation settles.
  • Add actual hook coverage for pausing discovery with the panel open or unmounted, background completion compaction, exact counts, and no unnecessary reconnect. Add a global-control regression for compacted paused children.

Screenshots / Demo

Actual npm run dev Electron UI on macOS, downloading a 400-file folder from a Linux SSH test host:

  1. Download status becomes Transferring and exposes Pause.
  2. Pause at 85/400 remains stable; Resume advances normally.
  3. Pause again at 367/400, close the SFTP side panel, and resume from the global transfer center.
  4. The task reaches Completed, 400 files. All 400 local filenames and file contents match the expected fixture bytes exactly.

The original build reproduced Queued during active transfer. Intermediate repair validation also exposed the lost child pause latch and duplicate count; the final implementation passes the full sequence above.

Testing

  • Tested locally with npm run dev, including two pause/resume cycles and panel closure
  • npm run lint passes
  • npm test passes: 11,478 passed, 18 skipped, 0 failed
  • Generated capability tool specs: not applicable
  • No new console errors or warnings — not asserted beyond the successful observed flows

180 focused transfer tests passed. The first full-suite run encountered 7 unrelated plugin archive failures because this worktree lacked package-local dependencies and resolved yauzl 2.10 instead of 3.4. After restoring the package dependency layout, the full suite passed with 11,478 passed, 18 skipped, and 0 failed. The new direct-download test uses .test.ts so the normal test command includes it.

A prior full TypeScript comparison reported the same 732 diagnostics on the baseline and fix, with no new normalized diagnostics at that comparison point; this is not a clean typecheck.

Checklist

  • Existing project architecture and style followed
  • Relevant behavior and validation documented above
  • No intentional breaking changes

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T08:40:57.233194Z b2fc27d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@binaricat binaricat added the automation:codex-loop Own/bot PR waiting on Codex review↔fix loop label Sep 6, 2026
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat
binaricat marked this pull request as draft September 6, 2026 08:36
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: b2fc27d168

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@netcatty-bot
netcatty-bot marked this pull request as ready for review September 6, 2026 08:41
@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Sep 6, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex reported no major issues. This PR is marked ready for human review/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants