[PR #3106] [MERGED] Launcher: fetch the assets a stopped download left out, and stop waiting on quiet connections #4808

Closed
opened 2026-11-03 05:08:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3106
Author: @malordin
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/missing-assets-download


📝 Commits (2)

  • 2d98bf8 Launcher: fetch the assets a stopped download left out, and stop waiting on quiet connections
  • ff0c089 Launcher: refill the asset store at start-up, not on Play

📊 Changes

3 files changed (+150 additions, -4 deletions)

View changed files

📝 launcher/src/backend.rs (+77 -1)
📝 launcher/src/mojang.rs (+38 -3)
📝 launcher/src/mojang_tests.rs (+35 -0)

📄 Description

What and why

A download from Mojang that stops on the way (the assets' failure is one log line, The sounds could not all be downloaded) leaves the asset store with only some of its files. Every completion that copies from it (the sounds, the languages, #1870) then finds nothing to copy, and the game plays silent and in English. Prepare again does not help: the folder is found as it is, so it never reaches Mojang.

What I saw on a real install: horizon-launcher/minecraft/assets/objects held 524 of the index's 5147 objects, the "Resources" card said the version was prepared without sounds, and the language screen offered English only.

  • complete_assets asks the owner gate again (download_for_owner, the one door to Mojang's files) when Horizon's own store exists and a prepared version has no sounds or no languages, once per run. The download keeps the files already whole (sha1) and fetches the rest. It adds no call to mojang::download and names no host; a non-owner fetches nothing.
  • In that download each asset is tried three times and one that keeps failing does not stop the rest: the log says how many failed and the first one's reason, and the next run fetches what is left.
  • Requests had no timeouts, so one connection that went quiet held the whole download for ever (the run above stopped at 1983 files and never moved). The HTTP agent now gives up after 15 s to connect and 60 s without data. This reaches every request the launcher makes; the values are easy to change if you want others.

#3105 (merged) made the languages' check fire on a real jar, so with both, the install above went from 524 to 5147 objects, lang/ from 2 files to 144, pack.mcmeta and ru_ru present, sounds back, Русский in the language screen.

Vanilla reference

none (launcher).

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main, Windows, against upstream/main at 364922fa5)

Check Result
Scope ✅ 3 files, +128 −4
Cargo.lock ✅ unchanged
Public tree ✅
launcher rustfmt ✅
launcher tests ✅ 242 passed (mojang_downloads_only_for_an_owner now also checks a store that lacks assets and that refill_own_store goes through download_for_owner; new: a download goes on past an asset that keeps failing)
launcher clippy ❌ one error, not in this change: unused import std::os::windows::process::CommandExt at launcher/src/sources.rs:507 on Windows, present on upstream/main
Parity ➖ not run (--quick)
Python tests ❌ on my machine python3 is the Microsoft Store stub (I put a shim on PATH); 3 tests still fail (test_port_publish ×2, test_roadmap), none near this change. Not run against a clean main; CI's verify has the real answer.

Screenshots

n/a

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3106 **Author:** [@malordin](https://github.com/malordin) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/missing-assets-download` --- ### 📝 Commits (2) - [`2d98bf8`](https://github.com/horizon-rust/horizon/commit/2d98bf8dae3136e69386942cab6e563fa33574e8) Launcher: fetch the assets a stopped download left out, and stop waiting on quiet connections - [`ff0c089`](https://github.com/horizon-rust/horizon/commit/ff0c089ac58b8f3a4273029f449032b8b4ecb227) Launcher: refill the asset store at start-up, not on Play ### 📊 Changes **3 files changed** (+150 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/backend.rs` (+77 -1) 📝 `launcher/src/mojang.rs` (+38 -3) 📝 `launcher/src/mojang_tests.rs` (+35 -0) </details> ### 📄 Description ## What and why A download from Mojang that stops on the way (the assets' failure is one log line, `The sounds could not all be downloaded`) leaves the asset store with only some of its files. Every completion that copies from it (the sounds, the languages, #1870) then finds nothing to copy, and the game plays silent and in English. Prepare again does not help: the folder is found as it is, so it never reaches Mojang. What I saw on a real install: `horizon-launcher/minecraft/assets/objects` held 524 of the index's 5147 objects, the "Resources" card said the version was prepared without sounds, and the language screen offered English only. - `complete_assets` asks the owner gate again (`download_for_owner`, the one door to Mojang's files) when Horizon's own store exists and a prepared version has no sounds or no languages, once per run. The download keeps the files already whole (sha1) and fetches the rest. It adds no call to `mojang::download` and names no host; a non-owner fetches nothing. - In that download each asset is tried three times and one that keeps failing does not stop the rest: the log says how many failed and the first one's reason, and the next run fetches what is left. - Requests had no timeouts, so one connection that went quiet held the whole download for ever (the run above stopped at 1983 files and never moved). The HTTP agent now gives up after 15 s to connect and 60 s without data. This reaches every request the launcher makes; the values are easy to change if you want others. #3105 (merged) made the languages' check fire on a real jar, so with both, the install above went from 524 to 5147 objects, `lang/` from 2 files to 144, `pack.mcmeta` and `ru_ru` present, sounds back, `Русский` in the language screen. ## Vanilla reference none (launcher). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main`, Windows, against upstream/main at 364922fa5) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +128 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | launcher rustfmt | ✅ | | launcher tests | ✅ 242 passed (`mojang_downloads_only_for_an_owner` now also checks a store that lacks assets and that `refill_own_store` goes through `download_for_owner`; new: a download goes on past an asset that keeps failing) | | launcher clippy | ❌ one error, not in this change: unused import `std::os::windows::process::CommandExt` at `launcher/src/sources.rs:507` on Windows, present on upstream/main | | Parity | ➖ not run (--quick) | | Python tests | ❌ on my machine `python3` is the Microsoft Store stub (I put a shim on PATH); 3 tests still fail (`test_port_publish` ×2, `test_roadmap`), none near this change. Not run against a clean `main`; CI's `verify` has the real answer. | ## Screenshots n/a <!-- Allow edits by maintainers: ticked. --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
horizon-rust/horizon#4808
No description provided.