diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-08 13:21:02 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-08 13:21:02 +0200 |
| commit | 3c3ccf75edc007936d7c6e2d72b4ff289a5a97df (patch) | |
| tree | cfad17ef2f10cad15430195c7f87813d500998a1 /docs/USERGUIDE.md | |
| parent | 79520f5f2f9a38ef719fca4dc0f95b001b477e38 (diff) | |
| download | meshbay-3c3ccf75edc007936d7c6e2d72b4ff289a5a97df.tar.gz | |
fix(client): write a download to .part and rename it when it completes
`save:abort` deleted a cancelled download, but nothing covered the application
being quit, killed or crashing mid-transfer: the write stream was abandoned and
a truncated file kept the final name — the exact thing save:abort's own comment
calls worse than no file at all, because it looks complete to whoever opens it
next.
Downloads go to `<target>.part` and are renamed after the stream has flushed,
which is the convention the node already uses for uploads (`_do_file_upload`).
A crash now leaves a self-evidently unfinished file. `before-quit` also clears
any `.part` still open, synchronously — it does not wait for promises — so a
deliberate quit leaves nothing at all.
Verified by hand: .part during the transfer, survives SIGKILL, renamed on
completion, and gone after a cancel or a clean quit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCGdheDLxGReuKHga3BtST
Diffstat (limited to 'docs/USERGUIDE.md')
0 files changed, 0 insertions, 0 deletions