aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_stream_capacity.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-08 13:21:02 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-08 13:21:02 +0200
commit3c3ccf75edc007936d7c6e2d72b4ff289a5a97df (patch)
treecfad17ef2f10cad15430195c7f87813d500998a1 /packages/meshbay-node/tests/test_stream_capacity.py
parent79520f5f2f9a38ef719fca4dc0f95b001b477e38 (diff)
downloadmeshbay-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 'packages/meshbay-node/tests/test_stream_capacity.py')
0 files changed, 0 insertions, 0 deletions