Resuming and replacing
As in WinSCP by default, files under 100 KB aren’t resumed. Uploads write them straight to the destination name: the file is created exclusively, and you’re asked about overwriting only when the destination already exists; overwriting rewrites the file in place, so it keeps the original file’s permissions. A file that can’t be rewritten, such as a read-only one, is replaced the way described below instead, by moving it aside before the new file is published. The modification time is set as the file is closed. A file that fails partway is deleted, and one cut off by a dropped connection is sent again whole after reconnecting. Downloads still write to .filepart first and then rename it, but keep no resume record.
Files of 100 KB and up are first written to <destination file name>.filepart. Write requests go through a bounded pipeline, and once every write has been acknowledged and the file has closed successfully, its modification time (and, over an existing file, that file’s permissions) is set by path before the real file is published. Over an existing file, the old file is first moved to .shellrs-<UUID>.backup, then the new file is published and the backup deleted; this replacement isn’t atomic, as the destination is briefly missing between the two renames. Like WinSCP, transfers use no SFTP extensions (fsync@openssh.com, posix-rename@openssh.com and so on) and set no attributes on an open file: some bastion hosts refuse these requests, or even end the whole session over them. If the reply to a publish is lost, ShellRS recovers using the managed temporary path, the stage, the type and the size; when it can’t tell safely, it keeps the recovery files and reports it.
Resume records are kept in upload-resume/ in the app’s data folder, as versioned JSON written atomically; they never contain passwords, passphrases or private keys, and they don’t change the database schema. A record ties together the endpoint, host fingerprint, source, destination and safe-replace stage. Resuming works as in WinSCP: ShellRS reads the current size of the remote .filepart, skips that much of the local file and carries on; it’s up to you to make sure the source is still the same version. Uploads never read the remote file back to verify it.
Downloads
Section titled “Downloads”Downloads likewise write first to <destination file name>.filepart on this computer; when done, ShellRS sets the remote modification time, runs fsync (for files of 100 KB and up), and renames it to the real file within the same file system (an atomic replace). Concurrent read requests may come back out of order or short, but the temporary file is written strictly in order, because resuming trusts only its length. Download resume records are kept in download-resume/ and tie together the endpoint, host fingerprint, remote source with its size and modification time, and local destination; if the remote file changes, the download can’t resume and can only start over or be skipped.
Interrupted transfers
Section titled “Interrupted transfers”On network failures, each batch reconnects automatically up to three times, after 1, 3 and 10 seconds. After that, resume the batch with “Resume” in Transfers; resuming by hand resets the count. Authentication failures, a changed host key and a deliberate cancel need you to deal with them. Reconnecting uses the original connection settings, so editing the host doesn’t change the destination of a transfer in progress.
Cancelling, closing the tab, disconnecting or quitting keeps the resume records; closing a tab with a transfer in progress asks first. After a restart, transfers don’t continue by themselves; choosing the same source and destination again asks whether to resume. While a batch is stopped, “Discard partial transfer” cleans up its managed temporary files and any half-transferred small files; if there’s a recovery backup that can’t be judged safely, the files are kept and the reason is given. Items published successfully have their records and backups cleaned up automatically.
File names
Section titled “File names”When a file name can’t be represented exactly, ShellRS reports an error. The remote string decoding of the current russh-sftp 3.0.0 replaces invalid UTF-8, so the browser refuses remote names that contain the replacement character U+FFFD, to avoid acting on the wrong path. Symbolic links use OpenSSH’s SFTP v3 argument order.
Not implemented yet: folder sync in SFTP tabs (the external CLI’s shellrs sync can sync), a foreground transfer progress dialog, reordering the queue, filtering, a folder tree, and keeping the Dock layout.