[PR #5401] [MERGED] Packs: read a pack.mcmeta with a comment after its JSON #6261

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5401
Author: @Teiwazik
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/pack-meta-trailing-text


📝 Commits (2)

  • 01b0596 Packs: read a pack.mcmeta with a comment after its JSON
  • fefde53 Merge main into #5401 (main's title keyboard test was fixed in #5425)

📊 Changes

1 file changed (+18 additions, -2 deletions)

View changed files

📝 crates/horizon-client-render/src/packs.rs (+18 -2)

📄 Description

🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally.

What

read_meta now takes the first JSON value of a pack.mcmeta and ignores what follows it, so a pack signed with a comment after the closing brace shows up in the list. The byte order mark handling stays, and a file that doesn't start with JSON is still refused.

I didn't compare this with vanilla's parser (Gson); that comparison isn't part of this change.

Tests

a_comment_after_the_metadata_does_not_hide_a_pack, and the existing mcmeta_with_utf8_bom_is_read. A pack with such a comment was also seen in the list in game, on our fork's client.

Fixes #5400

Windows note. On this machine pr_ready can't build main: horizon-threads lacks the windows-sys features boot_paint uses (#5298, #5299), which is why clippy, tests and doc tests are red in the block below. The block is from main at 47f372fee. With those features turned on locally, not committed, on main at 5d16a611c:

  • cargo clippy --profile fast -p horizon-client-render --all-targets --no-deps -- -D warnings passes;
  • cargo test -p horizon-client-render --lib passes;
  • cargo fmt --all --check passes.

Not run: parity harnesses and lan_e2e. CI runs on Linux and doesn't have this problem.

pr_ready (tools/pr_ready.py --quick on Teiwazik, against origin/main at 47f372fee, 2 min 4 s)

Check Result
Scope ✅ 1 files, +18 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 505 passed (1 min 4 s)
rustfmt ✅ (11 s)
clippy ❌ failed (14 s)
tests: horizon-client-render ❌ failed (27 s)
doc tests ❌ failed (5 s)
content root tests ➖ content root untouched
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 Claude Code

https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL


🔄 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/5401 **Author:** [@Teiwazik](https://github.com/Teiwazik) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pack-meta-trailing-text` --- ### 📝 Commits (2) - [`01b0596`](https://github.com/horizon-rust/horizon/commit/01b05967ea6880227be701da993d37148fd4310c) Packs: read a pack.mcmeta with a comment after its JSON - [`fefde53`](https://github.com/horizon-rust/horizon/commit/fefde530598c33e232a1f8149e960ca365531f88) Merge main into #5401 (main's title keyboard test was fixed in #5425) ### 📊 Changes **1 file changed** (+18 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/packs.rs` (+18 -2) </details> ### 📄 Description > 🤖 Opened by Teiwazik's AI agent (Claude Code, Claude Opus 5.5), not by Teiwazik personally. ## What `read_meta` now takes the first JSON value of a `pack.mcmeta` and ignores what follows it, so a pack signed with a comment after the closing brace shows up in the list. The byte order mark handling stays, and a file that doesn't start with JSON is still refused. I didn't compare this with vanilla's parser (Gson); that comparison isn't part of this change. ## Tests `a_comment_after_the_metadata_does_not_hide_a_pack`, and the existing `mcmeta_with_utf8_bom_is_read`. A pack with such a comment was also seen in the list in game, on our fork's client. Fixes #5400 **Windows note.** On this machine `pr_ready` can't build main: `horizon-threads` lacks the `windows-sys` features `boot_paint` uses (#5298, #5299), which is why clippy, tests and doc tests are red in the block below. The block is from main at 47f372fee. With those features turned on locally, not committed, on main at 5d16a611c: - `cargo clippy --profile fast -p horizon-client-render --all-targets --no-deps -- -D warnings` passes; - `cargo test -p horizon-client-render --lib` passes; - `cargo fmt --all --check` passes. Not run: parity harnesses and `lan_e2e`. CI runs on Linux and doesn't have this problem. **pr_ready** (`tools/pr_ready.py --quick` on Teiwazik, against origin/main at 47f372fee, 2 min 4 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +18 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 505 passed (1 min 4 s) | | rustfmt | ✅ (11 s) | | clippy | ❌ failed (14 s) | | tests: horizon-client-render | ❌ failed (27 s) | | doc tests | ❌ failed (5 s) | | content root tests | ➖ content root untouched | | 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 [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EBqm1v5zTsDGwuZF6XKFjL --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:31 +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#6261
No description provided.