Copy reports which files failed, not just how many #19
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
wokoman/ironpod!19
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/copy-summary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a copy finishes with failures, both front ends can now say which files failed and why, not just how many.
The information existed at the moment each file failed and was then thrown away: the per-file callback received the outcome borrowed, so no caller could keep an error even if it wanted to. The browser did not try — it counted the failure and dropped the reason. For a copy of several hundred files off a network share, "5 failed" is not an answer anyone can act on.
copy_allnow returns the summary it was already computing — copied, duplicates, untitled, and each failed file with its reason — and hands the running summary to the progress callback, so the callback stays for what genuinely needs to be a callback: telling the caller where the run has got to so it can repaint. Neither front end assembles counts by hand any more, including the dry run, which folds its outcomes into the same type through the same rules. The rule about when to suggest installing ffmpeg lives on the summary, so the two places that used to restate it now ask it.Command-line output is unchanged. In the browser, a copy that had failures opens the popup listing each file and its reason — reusing the viewer behind
wrather than inventing a second list, as the ticket asked.The summary is asserted with no device attached: a batch of three — one file, the same file again, and a
.mp3that is not an MP3 — comes back as one copied, one duplicate, one failed, with the failure naming the right file and carrying a non-empty reason, and the callback observed to see the run advance 1, 2, 3.Also fixes a race I introduced in #15. The three batch-removal tests each built their audio files at fixed temp paths and deleted them when done, so running in parallel one test could delete a file another was still copying — it surfaced as
copy into the fixture: stat …/ironpod-<pid>-batch-first.mp3. It was behind the intermittent failure I flagged in #17 and could not reproduce at the time. Temp audio files now get a unique suffix per call, not per name. Measured: two failures in twenty runs before, none in twenty after.67 unit tests pass,
cargo clippy --all-targetsclean.Closes #7.