Skip to content

fix(desktop): a download fails only when it stalls, not when it takes longer than 30 seconds - #830

Merged
dustywusty merged 1 commit into
mainfrom
dustywusty/fix-download-stall
Oct 27, 2026
Merged

dustywusty merged 1 commit into
mainfrom
dustywusty/fix-download-stall

Conversation

@dustywusty

Copy link
Copy Markdown
Collaborator

What

A download in OpenBot Desktop now fails only when it stalls for 30 seconds, not when it takes longer than 30 seconds in total.

Root cause

  • Where: deployment::get (desktop/src-tauri/src/deployment.rs), present since get() was written in Desktop shell: the window, the engine it acquires, and the stack it raises #392. It is shared by the release download, Bun, Compose and the engine installers.
  • How: it read the body with reqwest::blocking::Response::bytes(). The blocking client's default 30-second timeout bounds the whole body read there, and running out is reported as error decoding response body.
  • Effect: any download taking over 30 seconds failed however steadily it was arriving. Bun's ~30 MB fails every time on a connection under about 1 MB/s.
  • Why it went unnoticed: fast connections finish everything inside 30 seconds, and the error text points at decoding, not time.

The fix

The body is read as a stream (read_to_end), where the client's timeout bounds each read. A download is abandoned only after 30 seconds with nothing arriving. The constant is named IDLE_TIMEOUT so the meaning is explicit.

Test

A new slow-server test drips the body in pieces, each gap well under the limit, for longer than the limit in total. It fails on the old code with the old message and passes now. The full desktop Rust suite passes (543 + 148).

… longer than 30 seconds

deployment::get read the body with bytes(), which the blocking client bounds by its 30-second
default timeout and reports as 'error decoding response body' when that runs out. Any download
taking longer than 30 seconds failed however steadily it arrived: Bun's 30 MB on a connection under
about 1 MB/s, the Compose and Podman downloads, and the release lookup. Present since get() was
written (#392). The body is now read as a stream, where the timeout bounds each read, so a download
is given up only after 30 seconds with nothing arriving. A slow-server test fails with the old
code's exact message and passes now.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-27T22:04:47.465612Z bcfbc73 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@guidovizoso guidovizoso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly right: a slow but steady download shouldn't fail, and today's 'error decoding response body' is a bad first impression. Approving the change. Can it come out of draft? It still matters for the release download after #852.

@dustywusty
dustywusty merged commit bb2fb43 into main Oct 27, 2026
25 checks passed
@dustywusty
dustywusty deleted the dustywusty/fix-download-stall branch October 27, 2026 22:39
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.

2 participants