Skip to content

fix: replace recursive byte-counting with entry-based transfer progress#395

Merged
veeso merged 2 commits into
0.20from
fix/384-do-not-calculate-entire-transfer-size
Feb 28, 2026
Merged

fix: replace recursive byte-counting with entry-based transfer progress#395
veeso merged 2 commits into
0.20from
fix/384-do-not-calculate-entire-transfer-size

Conversation

@veeso
Copy link
Copy Markdown
Owner

@veeso veeso commented Feb 28, 2026

Summary

  • Replace the expensive recursive get_total_transfer_size pre-calculation with a lightweight entry-based counter (TransferProgress) for the overall progress bar
  • Eliminate code duplication between _any and _recurse transfer methods by adding a track_progress parameter to _recurse, making _any a thin wrapper
  • Per-file byte-level progress bar (ProgressStates) remains unchanged; bytes still tracked via TransferStates::add_bytes for notification thresholds

Closes #384

Test plan

  • Existing unit tests pass (transfer_progress, transfer_states, progress_states)
  • cargo clippy --no-default-features -- -Dwarnings passes
  • Manual test: upload a large directory tree over FTP — verify no idle-timeout disconnection
  • Manual test: verify progress bar updates per top-level entry during directory transfers
  • Manual test: verify single-file transfers show 0/1 → 1/1 progress

Replace the expensive recursive `get_total_transfer_size` pre-calculation
with a lightweight entry-based counter (`TransferProgress`) for the
overall progress bar. This avoids deep `list_dir` traversals before
transfers begin, which could cause FTP idle-timeout disconnections on
large directory trees.

The per-file byte-level progress bar (`ProgressStates`) remains
unchanged. Bytes are still tracked via `TransferStates::add_bytes` for
notification threshold logic.

Closes #384
@cocogitto-bot
Copy link
Copy Markdown

cocogitto-bot Bot commented Feb 28, 2026

✔️ c321fe7...3ff17b3 - Conventional commits check succeeded.

@veeso veeso merged commit 34f1503 into 0.20 Feb 28, 2026
8 checks passed
@veeso veeso deleted the fix/384-do-not-calculate-entire-transfer-size branch February 28, 2026 16:41
@veeso veeso mentioned this pull request Apr 18, 2026
veeso added a commit that referenced this pull request Apr 18, 2026
…ss (#395)

* fix: replace recursive byte-counting with entry-based transfer progress

Replace the expensive recursive `get_total_transfer_size` pre-calculation
with a lightweight entry-based counter (`TransferProgress`) for the
overall progress bar. This avoids deep `list_dir` traversals before
transfers begin, which could cause FTP idle-timeout disconnections on
large directory trees.

The per-file byte-level progress bar (`ProgressStates`) remains
unchanged. Bytes are still tracked via `TransferStates::add_bytes` for
notification threshold logic.

Closes #384
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