[PR #1692] [MERGED] Packs: open streamed archives the way Java's ZipFile does #3692

Closed
opened 2026-11-03 04:11:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1692
Author: @socksprox
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/streamed-server-pack-zip


📝 Commits (2)

  • 348675c Packs: open streamed archives the way Java's ZipFile does
  • e7f85e5 Zip: test the streamed shapes Java 25's ZipFile opens

📊 Changes

1 file changed (+112 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/zip.rs (+112 -1)

📄 Description

🤖 Opened by an AI agent (Devin) on behalf of socksprox, not by a human.

Summary

Joining a server whose required resource pack is served as a streamed zip never got past the pack. resourcepack.gommehd.io (gommehd.net's required pack, a Nexo-generated file) writes:

  • every local header as a 30-byte stub (empty name, zero sizes),
  • 0xFFFFFFFF as every central directory entry's uncompressed size,
  • an END record claiming disk 0xFFFF and 0 entries.

Java's ZipFile ignores all three and opens it; the zip crate's ZipArchive does not — the END record reads as multi-disk and empty, so ZipArchive::new fails ("Could not find EOCD"). The pack's metadata check then failed, FAILED_RELOAD went back for a required pack, and the join never completed — in the wild each retry also rebuilt the renderer, about once a second.

  • Zip::from_bytes walks the real central directory, counts entries, and rewrites the END record's disk/count fields only when they disagree with what is actually there — the Java tolerance, scoped to broken records.
  • Zip::read caps the inflate output when an entry's size is the 0xFFFFFFFF sentinel instead of trusting it.
  • Regression test reproduces the streamed shape.

Verified end to end on gommehd.net with a signed-in account: the required pack (3,730 entries) downloads, loads and applies, and the join reaches the lobby.

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at 947d65e64, 3 min 14 s)

Check Result
Scope ✅ 1 files, +106 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (7 s)
clippy ✅ (1 min 15 s)
tests: horizon-client ✅ 1201 passed (1 min 50 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Devin (Cognition)


🔄 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/1692 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/streamed-server-pack-zip` --- ### 📝 Commits (2) - [`348675c`](https://github.com/horizon-rust/horizon/commit/348675c5387a11a8992a99428b7609bd78047c58) Packs: open streamed archives the way Java's ZipFile does - [`e7f85e5`](https://github.com/horizon-rust/horizon/commit/e7f85e5bfd55783f91348a7f9c6701d201e1cda3) Zip: test the streamed shapes Java 25's ZipFile opens ### 📊 Changes **1 file changed** (+112 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/zip.rs` (+112 -1) </details> ### 📄 Description > 🤖 Opened by an AI agent (Devin) on behalf of socksprox, not by a human. ## Summary Joining a server whose required resource pack is served as a *streamed* zip never got past the pack. `resourcepack.gommehd.io` (gommehd.net's required pack, a Nexo-generated file) writes: - every local header as a 30-byte stub (empty name, zero sizes), - `0xFFFFFFFF` as every central directory entry's uncompressed size, - an END record claiming disk `0xFFFF` and 0 entries. Java's `ZipFile` ignores all three and opens it; the `zip` crate's `ZipArchive` does not — the END record reads as multi-disk and empty, so `ZipArchive::new` fails ("Could not find EOCD"). The pack's metadata check then failed, `FAILED_RELOAD` went back for a required pack, and the join never completed — in the wild each retry also rebuilt the renderer, about once a second. - `Zip::from_bytes` walks the real central directory, counts entries, and rewrites the END record's disk/count fields only when they disagree with what is actually there — the Java tolerance, scoped to broken records. - `Zip::read` caps the inflate output when an entry's size is the `0xFFFFFFFF` sentinel instead of trusting it. - Regression test reproduces the streamed shape. Verified end to end on gommehd.net with a signed-in account: the required pack (3,730 entries) downloads, loads and applies, and the join reaches the lobby. **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at 947d65e64, 3 min 14 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +106 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 15 s) | | tests: horizon-client | ✅ 1201 passed (1 min 50 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with Devin (Cognition) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:28 +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#3692
No description provided.