[PR #4395] [MERGED] Accept a UTF-8 byte-order mark in server pack.mcmeta #5603

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4395
Author: @DUzzL
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/issue-4388-mcmeta-bom


📝 Commits (2)

  • c274dad Read pack.mcmeta with a UTF-8 byte order mark (#4388)
  • fd21d6e Cover no-BOM and partial-BOM pack.mcmeta (#4388)

📊 Changes

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

View changed files

📝 crates/horizon-client-render/src/packs.rs (+21 -1)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Refs #4388. This PR does not close the issue: the cause is not confirmed. The fix is for one plausible cause only.

Hypothesis: a UTF-8 byte-order mark (EF BB BF) at the start of a server pack's pack.mcmeta makes serde_json reject the file, while Gson accepts it. That would cause the reported "invalid pack metadata, ignoring all" error. The reporter's server pack was not available, so the BOM is not confirmed.

Change: read_meta in crates/horizon-client-render/src/packs.rs strips a leading BOM before parsing. Files without a BOM are unchanged, and a partial BOM still fails. Unit tests cover all three cases. Other read_meta failures (a missing or nested pack.mcmeta, comments or trailing commas that Gson tolerates) are not addressed. The reload still fails as a whole on any unreadable pack, as before.

Tested: cargo fmt --check, cargo clippy -p horizon-client-render --all-targets -- -D warnings, and cargo test -p horizon-client-render --lib packs:: (12 passed, 1 ignored) pass. horizon-client tests not run.

Not tested: no live server or the reporter's pack, so the BOM is unconfirmed. tools/pr_ready.py not run.


🔄 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/4395 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/issue-4388-mcmeta-bom` --- ### 📝 Commits (2) - [`c274dad`](https://github.com/horizon-rust/horizon/commit/c274dad88d75af7afc9ed0384b55e4c489ff861f) Read pack.mcmeta with a UTF-8 byte order mark (#4388) - [`fd21d6e`](https://github.com/horizon-rust/horizon/commit/fd21d6ee82d6651c931a02dfe8146dd8d5e5777a) Cover no-BOM and partial-BOM pack.mcmeta (#4388) ### 📊 Changes **1 file changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/packs.rs` (+21 -1) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Refs #4388. This PR does not close the issue: the cause is not confirmed. The fix is for one plausible cause only. **Hypothesis:** a UTF-8 byte-order mark (EF BB BF) at the start of a server pack's `pack.mcmeta` makes `serde_json` reject the file, while Gson accepts it. That would cause the reported "invalid pack metadata, ignoring all" error. The reporter's server pack was not available, so the BOM is not confirmed. **Change:** `read_meta` in `crates/horizon-client-render/src/packs.rs` strips a leading BOM before parsing. Files without a BOM are unchanged, and a partial BOM still fails. Unit tests cover all three cases. Other `read_meta` failures (a missing or nested `pack.mcmeta`, comments or trailing commas that Gson tolerates) are not addressed. The reload still fails as a whole on any unreadable pack, as before. **Tested:** `cargo fmt --check`, `cargo clippy -p horizon-client-render --all-targets -- -D warnings`, and `cargo test -p horizon-client-render --lib packs::` (12 passed, 1 ignored) pass. `horizon-client` tests not run. **Not tested:** no live server or the reporter's pack, so the BOM is unconfirmed. `tools/pr_ready.py` not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:42 +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#5603
No description provided.