Skip to content

fix(update): stream binary update with progress and stall timeout#43

Merged
damusix merged 1 commit into
masterfrom
fix/update-progress-stall
Jul 11, 2026
Merged

fix(update): stream binary update with progress and stall timeout#43
damusix merged 1 commit into
masterfrom
fix/update-progress-stall

Conversation

@damusix

@damusix damusix commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • noorm update (binary install path) streamed the ~70MB release binary with a bare fetch() — no timeout — so a stalled connection hung the process forever with no error and no output. Replaced with a streaming download that shows live progress and aborts on a 30s stall.
  • Fixed a latent EXDEV in the atomic swap: the temp file was written to os.tmpdir() and rename()d onto ~/.local/bin, which throws across volumes on macOS. It now stages in the target's own directory.
  • Added update:progress events; the CLI renders Downloading X / Y MB (Z%) on a TTY.

What this solves

A user's noorm update sat on "Installing..." for 2+ minutes with no feedback and no way to tell a slow download from a dead one. The real asset downloads in ~1.4s; the hang was an unbounded fetch with no progress. Now it either shows progress, completes, or fails fast with a clear reason.

Tests

New tests/core/update/updater.test.ts drives the real streaming path against a live local HTTP server (no fetch/fs mocks): full-body stream + executable bit, monotonic progress reaching the total, a stall that aborts in bounded time (reproduces the reported hang), and a 404 surfacing its status.

A bare fetch() with no timeout hung forever on a stalled connection, with
no error surfaced and no progress shown. Stream to disk with a live
progress readout, abort on a 30s stall, and stage the swap in the
target's own directory to avoid a cross-filesystem EXDEV rename.
@damusix damusix merged commit 45b1f5f into master Jul 11, 2026
4 checks passed
@damusix damusix deleted the fix/update-progress-stall branch July 11, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant