Repository navigation
Opening an XLSX with a part over 512 MB says how to get the data in - #1248
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #1242.
Thanks @dev-exe for suggesting the error should tell people how to get unblocked. Opening an XLSX where one part unpacks to more than the reader's 512 MB per-part cap (
MAX_PARTincrates/xlsx/src/package.rs) used to say:It now says:
The limit itself is unchanged: raising it, or streaming very large sheets, is your call.
I only suggest what the code actually lets through:
read_filelimit.crates/xlsx/src/xlsb.rs), far less than a 515 MB sheet holds.xl/sharedStrings.xml, which every sheet shares), splitting sheets doesn't help, so the message only suggests CSV.gridcraft_xlsx::oversized_partfinds the part from the zip directory's declared sizes, and the engine uses it only whenread_xlsxreturnsTooLarge. A part that lies about its size and is caught while inflating keeps the old message.Validation:
io::tests::a_part_over_the_size_limit_says_how_to_get_the_data_inpatches the declared size in the central directory, so it needs no 512 MB fixture. It fails on main with the message above and passes here. It also covers the shared-strings case, a size just over the limit (shown as "more than 512 MB", never "512 MB"), and a package broken for another reason, which keeps its own error.cargo test -p gridcraft-engine --lib io::tests,cargo test -p gridcraft-xlsx --lib tests::malformed,cargo clippy -p gridcraft-xlsx -p gridcraft-engine --all-targets -- -D warnings,cargo fmt --all -- --check,cargo check -p gridcraft-engine --target wasm32-unknown-unknown