-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
SFTP file operations (download_file_from_sftp, upload_file_to_sftp, copy) read entire files into a Vec<u8>, which will OOM on large files.
Current State
src-tauri/src/locations/sftp/mod.rs:385—sftp.read(remote_path)loads full filesrc-tauri/src/locations/sftp/mod.rs:408—tokio::fs::read(local_path)loads full filesrc-tauri/src/locations/sftp/mod.rs:268—copy()reads full file into memory- Same pattern exists in SMB provider (via sidecar)
Proposed Changes
Use russh-sftp's open() + chunked read()/write() instead of the convenience read()/write() methods:
let file = sftp.open(path).await?;
let mut buf = vec![0u8; 64 * 1024]; // 64KB chunks
loop {
let n = file.read(&mut buf).await?;
if n == 0 { break; }
dest.write_all(&buf[..n]).await?;
}Acceptance Criteria
- File transfers use constant memory regardless of file size
- Downloads stream to disk in chunks
- Uploads stream from disk in chunks
- Copy streams through a temp file without full buffering
- Progress reporting for large transfers (nice-to-have)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request