[
https://issues.apache.org/jira/browse/TIKA-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106059#comment-18106059
]
ASF GitHub Bot commented on TIKA-4814:
--------------------------------------
tballison commented on PR #3018:
URL: https://github.com/apache/tika/pull/3018#issuecomment-5347737204
Did another deep dive. Changes are really good. Found a few more things via
Claude:
```
1. The headline O(n²) fix isn't one on the package side (confirmed by
skeptic). findStorageIndex*Mapping calls indexStorageMappings() on every lookup
(MSOneStorePackage.java:205-253), which rebuilds two full key lists and
list-equals them before the O(1) get — still O(n) per lookup with more
allocation
than the old linear scan; lookup count scales with cells + chain
revisions, so still quadratic overall. Production never mutates the mapping
lists
mid-parse; the staleness machinery exists only to satisfy
MSOneStoreParserTest.testStorageMappingIndexesSeePublicListUpdates, a
mutation-visibility
contract the test itself invented. Fix: build once (or identity/dirty
check), delete both key classes + indexed* fields (~70 lines), drop/rewrite the
pinning test. The parser-side maps are genuinely fixed.
2. CHANGES.txt: duplicate TIKA-4327 entry (main already has one, line
~548); ~250 lines of trailing-whitespace churn on historical sections; the two
new
entries themselves add trailing whitespace. Keep only the TIKA-4814
entry.
3. Silent-empty modes need one-line observability (skeptic-endorsed
shape): keep the all-or-nothing fallback design (partial fallback would dump
stale
superseded objects), but add LOG.warn + a parse-warning when a root
declare fails to resolve / a referenced object group is missing, upgrade the
live-content cell skips (MSOneStoreParser.java:283,289) from DEBUG to
WARN, and add one WARN in OneNoteParser.java:171 before the legacy dump. Today a
damaged file can parse "successfully" to an empty body with zero signal.
4. Two factually wrong javadocs: EmbeddedResourceInfo carries
PropertyAction's description (MSOneStorePackage.java:599-602);
ObjectDataBLOBDataElementData.java:39-45 says "returns the length" on a
deserialize method. Plus the parser-side find* javadocs still lack the
nullability
note their package-side twins got.
Cheap test additions worth requesting
- Markup is pinned nowhere — every test uses text handlers, so the
div-balance fix (prior Tier-1 #2) is unpinned. Swap one synthetic walk to
ToXMLContentHandler, assert class="page" count/balance and
closure-on-throw.
- removeSupersededObjects untested (the test groups contain no objects to
supersede).
- Real fixture: embedded-image test isn't exactly-once
(assertFalse(isEmpty()) passes on double extraction — the exact prior
complaint); page order never
asserted on a real file; and the synthetic order test passes trivially
if "page one" is dropped entirely (indexOf = −1) — I verified this one myself;
add
assertContains first.
- Depth caps on collectActions/collectReferencedCells unpinned (only
walkObject's is); a mixed root-resolution test pinning the chosen fallback
behavior.
- ORIGINAL_AUTHORS asserted nowhere; two CREATOR assertions depend on
HashSet iteration order.
```
> Onenote parsing only takes last item on each page
> -------------------------------------------------
>
> Key: TIKA-4814
> URL: https://issues.apache.org/jira/browse/TIKA-4814
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 3.3.2
> Environment:
> {code:java}
> ❯ java --version
> openjdk 26.0.2 2026-07-21 OpenJDK Runtime Environment Homebrew (build 26.0.2)
> OpenJDK 64-Bit Server VM Homebrew (build 26.0.2, mixed mode, sharing)
> ❯ uname -a
> Darwin Henrys-MBP.localdomain 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11
> 15:25:34 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6020 arm64{code}
> Reporter: Henry Lindeman
> Priority: Major
> Attachments: Downloadme.onepkg
>
>
> I made a test onenote file and tried to parse it with the cli as described in
> the tika readme, and it only showed the last element on each page
> {code:java}
> ❯ java -jar tika-app/target/tika-app-4.0.0-SNAPSHOT.jar --text
> ../datasets/onenote/ToDownload/Downloadme.onepkg
> INFO [main] 12:56:37,927 org.apache.tika.cli.TikaCLI As a convenience,
> TikaCLI has turned on several non-default features
> as specified in
> tika-app/src/main/resources/tika-config-default-single-file.json.
> See: TIKA-2374, TIKA-4017, TIKA-4354 and TIKA-4472).
> This is not the default behavior in Tika generally or in tika-server.
> Downloadme/Open Notebook.onetoc2
> Downloadme/Untitled Section.one
> Highlighted Text
> Comic sans
> Downloadme/Section 2.one
> {code}
> onedrive sharing link:
> [Downloadme|https://1drv.ms/o/c/98705a8ca0add89e/IgBEW7OVk9slSKq8sJeJUTkbAQ6K3mNiiRNLGRNh5sniyq0?e=g3aSgg]
>
> I also vibe-coded a fix for this. lmk if you want it.
> [https://github.com/henry-lindeman-glean/tika/pull/1]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)