Skip to content

feat: add recover subcommand for partial downloads#125

Open
jerzydziewierz wants to merge 2 commits inton0-computer:mainfrom
jerzydziewierz:feat/recover-partial-download
Open

feat: add recover subcommand for partial downloads#125
jerzydziewierz wants to merge 2 commits inton0-computer:mainfrom
jerzydziewierz:feat/recover-partial-download

Conversation

@jerzydziewierz
Copy link
Copy Markdown

Summary

  • Adds a recover subcommand that extracts complete files from interrupted downloads
  • Opens the .sendme-recv-* temp directory offline, checks each blob's completeness via BlobStatus, and exports only fully verified files to a user-specified output directory
  • No network connection required — purely local recovery from the iroh-blobs FsStore

Usage

sendme recover --output <DIR> .sendme-recv-<hash>

Skips incomplete/missing blobs with a message, reports recovered vs skipped counts.

Test plan

  • Interrupt a sendme receive mid-transfer, verify .sendme-recv-* directory persists
  • Run sendme recover --output <dir> .sendme-recv-<hash> on the interrupted store
  • Verify complete files are exported correctly, incomplete ones are reported as skipped
  • Verify relative and absolute --output paths both work
  • Verify error when store path is not a .sendme-recv-* directory

George Rey added 2 commits March 30, 2026 18:45
…wnloads

When a download is interrupted, the .sendme-recv-* temp directory retains
verified blob data on disk. This adds a `recover` subcommand that opens
the store offline, checks each blob's completeness, and exports only
fully verified files to a user-specified output directory — no network
connection required.
iroh-blobs FsStore requires absolute paths for export targets.
Relative paths caused every file export to fail with Error::Io.
@n0bot n0bot bot added this to iroh Mar 30, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Mar 30, 2026
@dignifiedquire dignifiedquire moved this from 🚑 Needs Triage to 👀 In review in iroh Apr 7, 2026
@wkornewald
Copy link
Copy Markdown

Wouldn't it be nicer to have receive automatically recover by default?

@jerzydziewierz
Copy link
Copy Markdown
Author

Wouldn't it be nicer to have receive automatically recover by default?

Well, it kind of attempts to do that, BUT that only works if the source server is still connected.
This extra option works without trying to connect to the server first; in fact it works completely offline;
Moreover, this option recovers the hash of the download from the (partially) downloaded files without the need to provide the original hash in the CLI.

In other words, all round new capability and usability here.

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

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants