fix(update): a failed connection to a release server is tried again over IPv4 alone, and the error names the server #349

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/connect-ipv4-fallback into main 2026-11-28 20:01:38 +00:00
Owner

The nightly launcher's builder download can stop with a bare "timeout: connect" that names no server and gives no hint (Longshot#2752: nightly 224, Windows 11, no luck with or without a VPN). This makes a failed connection try again over IPv4 alone, and makes the final error say which server could not be reached.

What changes

  • src/update/releases.rs: every release request goes through one get. When the connection itself fails (timeout, no route, the name does not resolve), it is sent once more by an agent limited to IPv4. A network whose IPv6 route is dead makes each address of a name wait out its own 15 s connect timeout; IPv4 alone reaches the same server.
  • When both tries fail, the error reads "Could not connect to git-cdn.magicbean.dev (…; over IPv4 only: …). Check the internet connection, a VPN or proxy, and that a firewall or antivirus lets the launcher reach it." instead of ureq's bare message.
  • HTTP status answers (403/404/5xx on the CDN, the existing CDN-to-origin fallback) behave as before.

Not known

The issue has no log, so the cause on that PC is not known: IPv6, a firewall, a regional block of the CDN or origin, and a proxy all give the same message. This helps the IPv6 case and tells the next reporter what to look at; it does not fix the other cases. The release lookups in src/game/releases.rs (json_url, the pull request list) still use ureq's default agent with no connect timeout; left alone here.

Testing

Checked: cargo check --locked, cargo clippy --locked -- -D warnings and cargo fmt pass on Linux.

Not checked (WIP for this reason): tests/test_launcher_core.py and Tooling's release suite were not run (this PC runs no test suites), nothing was run on Windows, and the fallback was not seen working against a network with a broken IPv6 route. No test exercises it: a unit test would need a server that accepts only IPv4.

Refs the issue; does not close it.

🤖 Generated with Claude Code

The nightly launcher's builder download can stop with a bare "timeout: connect" that names no server and gives no hint ([Longshot#2752](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2752): nightly 224, Windows 11, no luck with or without a VPN). This makes a failed connection try again over IPv4 alone, and makes the final error say which server could not be reached. ## What changes - `src/update/releases.rs`: every release request goes through one `get`. When the connection itself fails (timeout, no route, the name does not resolve), it is sent once more by an agent limited to IPv4. A network whose IPv6 route is dead makes each address of a name wait out its own 15 s connect timeout; IPv4 alone reaches the same server. - When both tries fail, the error reads "Could not connect to git-cdn.magicbean.dev (…; over IPv4 only: …). Check the internet connection, a VPN or proxy, and that a firewall or antivirus lets the launcher reach it." instead of ureq's bare message. - HTTP status answers (403/404/5xx on the CDN, the existing CDN-to-origin fallback) behave as before. ## Not known The issue has no log, so the cause on that PC is not known: IPv6, a firewall, a regional block of the CDN or origin, and a proxy all give the same message. This helps the IPv6 case and tells the next reporter what to look at; it does not fix the other cases. The release lookups in `src/game/releases.rs` (`json_url`, the pull request list) still use ureq's default agent with no connect timeout; left alone here. ## Testing Checked: `cargo check --locked`, `cargo clippy --locked -- -D warnings` and `cargo fmt` pass on Linux. Not checked (WIP for this reason): `tests/test_launcher_core.py` and Tooling's release suite were not run (this PC runs no test suites), nothing was run on Windows, and the fallback was not seen working against a network with a broken IPv6 route. No test exercises it: a unit test would need a server that accepts only IPv4. Refs the issue; does not close it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(update): a failed connection to a release server is tried again over IPv4 alone, and the error names the server
Some checks failed
CI / What the change needs (pull_request) Successful in 6s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 11s
PR title / Conventional Commit title (pull_request) Successful in 8s
CI / Release packages and stable upgrades (pull_request) Failing after 1m2s
CI / Rust formatting, lint and tests (pull_request) Successful in 10m52s
6b142fe065
The builder download stopped with a bare "timeout: connect" (Longshot #2752). A network whose IPv6 route is dead makes
every address of a name wait out its own connect timeout, so the request is tried once more over IPv4 alone, and when
that fails too the error says which server could not be connected to and what to check (VPN, proxy, firewall).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Member

Possibly related, for context:

  • issue MagicBeanDev/Longshot#2752 Install: — The PR explicitly addresses this failed builder-download connection report.
  • PR #115 fix(network): a silent IPv6 address no longer holds up IPv4, so a PC with broken IPv6 reaches git.magicbean.dev — Merged earlier IPv6/IPv4 connection handling; this PR retries with an IPv4-only agent.
Possibly related, for context: - issue MagicBeanDev/Longshot#2752 Install: — The PR explicitly addresses this failed builder-download connection report. - PR #115 fix(network): a silent IPv6 address no longer holds up IPv4, so a PC with broken IPv6 reaches git.magicbean.dev — Merged earlier IPv6/IPv4 connection handling; this PR retries with an IPv4-only agent.
HumanBean changed title from WIP: fix(update): a failed connection to a release server is tried again over IPv4 alone, and the error names the server to fix(update): a failed connection to a release server is tried again over IPv4 alone, and the error names the server 2026-11-28 20:01:35 +00:00
HumanBean deleted branch fix/connect-ipv4-fallback 2026-11-28 20:01:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!349
No description provided.