Repository navigation
Conversation
- Refuse nested cells and annotations during ODS preflight. - Preserve the recorded ZIP directory lookup for non-spreadsheet readers.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| // A digital-signature trailer may separate the directory from EOCD. Match | ||
| // calamine's ZIP lookup: otherwise take the first central header from p. | ||
| (p..central_end).find(|start| u32_at(bytes, *start) == Some(0x0201_4B50)).ok_or_else(bad)? | ||
| recorded |
There was a problem hiding this comment.
Behavior change for non-spreadsheet ZIP readers (KMZ and others). Before this PR, read inferred a preamble for any archive whose recorded offsets missed it. Now an archive with unrecorded leading bytes fails with not a zip archive (or a damaged one). The archive is valid, so that message is misleading, and nothing tells the user why the file was refused.
The PR says this is intended, so I'm not calling it a bug. Please either give this path a clearer error (for example, "the recorded directory offset doesn't match the archive layout; leading bytes aren't supported") or name the regression in the PR description. Confidence: medium. I didn't find a fixture that covers a KMZ-style archive with a preamble.
| for cell in ["<table:table-cell/>", "<table:covered-table-cell/>"] { | ||
| refused_before_calamine(&book(cell), "nested cell"); | ||
| } | ||
| let clean = book("<office:annotation><text:p>note</text:p></office:annotation><text:p><text:span>value</text:span></text:p>"); |
There was a problem hiding this comment.
Coverage gap on the "clean input gives no notice" side. The nested-annotation check depends on the open annotation being cleared at its matching End. This clean case only has one annotation per cell, so a regression that rejects two sibling annotations would not be caught.
Suggest adding a case such as <text:p>a<office:annotation><text:p>x</text:p></office:annotation>b<office:annotation><text:p>y</text:p></office:annotation></text:p> that must import with no notices. Confidence that the current code handles it correctly: high. The gap is in the tests.
Code reviewI read the full diff, the base Bugs
Security
Performance
Quality
AGENTS.md
Prior review threads: none. Nothing was left alone for that reason. Change sizeCompared: the whole PR against main (merge base 89220ea to PR head 29b989a).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Reject nested ODS cells and annotations before the workbook reader runs so malformed nesting cannot evade the spreadsheet memory limits. Ordinary annotations and formatted cell text still import.
Keep ZIP directory-offset inference specific to spreadsheets. KMZ and other ZIP readers once again use the offsets recorded in the archive.
The ODS check applies to the shared desktop, web, CLI, Python and phone readers. No commands, dependencies or saved formats change. Rejected files are left unchanged.
Testing
cargo xtask ciandpre-commit run --all-filespassed.RUSTFLAGS='-D warnings' cargo build --locked --target wasm32-unknown-unknown -p rustgis-webpassed.UI evidence
No visible UI change.
Related issue
Follow-up to #2359. Part of #2008.
Summary by CodeRabbit