Skip to content

refactor(sftp): decouple transfers from SFTP panel lifecycle#43

Open
CoolLoong wants to merge 4 commits into
iamazy:mainfrom
CoolLoong:main
Open

refactor(sftp): decouple transfers from SFTP panel lifecycle#43
CoolLoong wants to merge 4 commits into
iamazy:mainfrom
CoolLoong:main

Conversation

@CoolLoong

Copy link
Copy Markdown
Contributor

Problem

Closing the SFTP page during an upload/download freezes the progress bar at InProgress and breaks the cancel button.

Root cause:

transfer task lifecycle was owned by SftpTable, and progress/completion/cancel were reported back through a WeakEntity<TableState>. Once the page closed and the entity was dropped, the reporting closures stopped running, so the global TransferCenterState stayed stuck at InProgress and the cancel token became unreachable.

Solution

Move transfer task ownership from SftpTable to the global TransferCenterState:

  • Removed Transfer / TransferEntry / SftpTable.transfers and the table/transfers.rs module.
  • Upload/download now write to the global center via AsyncApp; the copy loop no longer depends on a WeakEntity, so it survives panel close.
  • Failure reasons are written to TransferTask.detail, so the footbar tooltip still shows them after the panel is gone.
  • disconnect() no longer touches transfer tasks, so closing the page never cancels in-flight transfers.
  • Terminal-state tasks auto-dismiss after AUTO_DISMISS_AFTER.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 298 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.56%. Comparing base (161e688) to head (8f59f96).

Files with missing lines Patch % Lines
crates/gpui_sftp/src/view/table/actions.rs 0.00% 298 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #43      +/-   ##
==========================================
+ Coverage   54.53%   54.56%   +0.02%     
==========================================
  Files         159      158       -1     
  Lines       54170    53906     -264     
==========================================
- Hits        29542    29413     -129     
+ Misses      24628    24493     -135     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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