fix: use XML hash for streaming shared strings#50
Closed
gwkline wants to merge 1 commit into
Closed
Conversation
This was referenced May 7, 2026
protobi-pieter
added a commit
that referenced
this pull request
May 7, 2026
…up (#66) * fix: use XML hash for streaming shared strings * Add regression tests for richText shared-string deduplication Covers the bug fixed in the cherry-picked commit: richText objects previously collapsed to hash key '[object Object]', deduping every richText cell into a single shared-string entry. Tests verify both correct deduplication and distinction by formatting. --------- Co-authored-by: Gavin Kline <gwkline23@gmail.com>
protobi-pieter
added a commit
that referenced
this pull request
May 7, 2026
Fixes critical bug in WorkbookWriter streaming with useSharedStrings: every richText cell collapsed into a single shared-string entry (richText objects coerced to '[object Object]' as hash key, deduping all of them). Cherry-picked from #50 by @gwkline; adds regression tests covering richText deduplication and formatting-aware distinction. Addresses upstream exceljs#2267. Also pins uuid to ^9.0.1 to keep browserify build working (uuid@14 dropped the main field; uuid@11 ships ES2021 syntax that browserify@16 cannot parse). Adds AGENTS.md with hard rules for AI-generated PRs. Files changed: - lib/utils/shared-strings.js: hash richText by rendered XML - spec/unit/utils/shared-strings.spec.js: 2 new regression tests - AGENTS.md: new (hard rules for AI agents) - README.md, CONTRIBUTING.md: pointers to AGENTS.md, release notes - .github/PULL_REQUEST_TEMPLATE.md: per-PR checklist - FORK.md: release notes - package.json, package-lock.json: version bump, uuid 8 -> 9 Tests: 886 unit tests passing (4 in SharedStrings, up from 2). PRs: #64 (uuid), #65 (AGENTS.md), #66 (richText fix)
Author
|
Thanks for pushing this along @protobi-admin! |
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.
Summary
useSharedStringsenabled was causing strings to be incorrectly repeated, likely due to[object Object]counting as one string in the cache. This patch uses the XML representation of these strings for the purpose of cacheing to avoid this issueTest plan
Before:

After:

Related to source code (for typings update)