Skip to content

XLS-352: pin every zip entry's mtime via zipEntryDate (supersedes #2) - #3

Open
senoff wants to merge 2 commits into
masterfrom
xls352-pin-zip-mtimes
Open

XLS-352: pin every zip entry's mtime via zipEntryDate (supersedes #2)#3
senoff wants to merge 2 commits into
masterfrom
xls352-pin-zip-mtimes

Conversation

@senoff

@senoff senoff commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Supersedes #2 — same fix (per-entry `zipEntryDate`, threaded to both the streaming and buffered write paths; module-level `zip:{date}` is a proven no-op), rebased onto `4294597` (the Print_Area reconcile fix) instead of directly on `master`.

Why superseded, not just an update to #2: `xlsx-for-ai-server` pins this fork by commit SHA, and its current pin (`4294597`) already includes the Print_Area reconcile fix. #2's commit (`cb42cbb`) branches from `8b2d62e`, one commit before `4294597` — pinning to it would silently drop that fix. Caught this via a real CI regression (2 failing Print_Area fidelity tests) after initially pinning `xlsx-for-ai-server` to `cb42cbb`.

Verified this session

  • Two-way check on the exact commit here: reverted to unpatched code — 6/6 assertions fail (byte-identity, entry-mtime, positive control, both writer paths); re-applied — 6/6 pass.
  • Full repo suites: 208 integration + 888 unit passing, 0 regressions.
  • Package version already carries 4.4.0-protobi.11; npm pack --dry-run shows the expected 187-file tarball. Actual npm publish is deliberately NOT done — held per the requesting handoff for the org's own SPM to authorize.

Note on CI

Note on --no-verify

  • The local pre-commit hook (eslint via lint-staged) failed on this file set, but every flagged line is pre-existing code outside this diff — the tracked prettier↔eslint config drift (already its own open PR, Fix prettier↔eslint config drift on comma-dangle functions protobi/exceljs#69). Per this repo's AGENTS.md rule 1 ("If the pre-commit hook fights you... commit with --no-verify... do NOT reshape unrelated code"), committed with --no-verify rather than touching unrelated lines or .eslintrc/.prettierrc.

#2 can be closed once this lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Vedui93dYwzJgZVtn1P7c

senoff and others added 2 commits August 11, 2026 14:05
…shing

The full loader (workbook.xlsx.load) threw
`TypeError: Cannot read properties of undefined (reading 'match')`
in colCache.decodeEx(undefined) when a workbook carried an
`_xlnm.Print_Area` defined name with no range — the artifact Excel and
some third-party writers leave behind when a print area is cleared. The
streaming reader (WorkbookReader) already tolerated it, so a file the
doctor/read path accepted was rejected by the write path.

Guard the decode on `definedName.ranges[0]` being present; an absent ref
means "no print area", matching Excel and the streaming reader. Valid
print areas are unaffected.

Regression: spec/unit/xlsx/xform/book/workbook-xform.spec.js — reconcile
tolerates empty Print_Area (no throw) and still reconciles a valid one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDNnWYdcu8CXnPPMLqxHMH
Threaded to both the streaming WorkbookWriter (via a shared _append choke
point) and the buffered xlsx.write/writeBuffer path (via ZipWriter's
finalize-time _pinEntryDates, covering JSZip's auto-created folder
entries too, which never pass through append). Fixes XLS-350's
byte-identity coin-flip: date is a per-entry zip option defaulting to
new Date() at append time, and a module-level zip:{date} is a no-op.

Rebased onto the Print_Area reconcile fix so this pin is available
without dropping that fix's coverage for downstream consumers pinning
this repo by commit SHA.

Verified this session (fresh checkout): red on unpatched code (6/6 fail),
green on the fix (6/6 pass, both writer paths), 208 integration + 888
unit tests, 0 regressions.

--no-verify: pre-commit eslint fails on PRE-EXISTING lines (comma-dangle,
space-before-function-paren, an import extension) untouched by this diff
-- the known prettier<->eslint config drift already tracked as PR#69 in
this repo. Per AGENTS.md rule 1, disclosed here rather than reshaping
unrelated code or touching .eslintrc/.prettierrc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant