[PR #5014] [CLOSED] fix(plist): match native data decoding #6733

Closed
opened 2026-11-01 21:42:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5014
Author: @therahimulislam
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/4978-plist-data-decoding


📝 Commits (2)

  • bef1042 fix(plist): match native data decoding
  • 7f94894 fix(plist): preserve raw data spelling

📊 Changes

4 files changed (+67 additions, -10 deletions)

View changed files

📝 src/domain/propertyListXml.test.ts (+13 -0)
📝 src/domain/propertyListXml.ts (+10 -1)
📝 src/domain/xmlDocument.ts (+29 -9)
📝 src/native/parsers/plist.test.ts (+15 -0)

📄 Description

Summary

Fixes #4978.

This updates XML plist <data> decoding to match the behavior observed from
Apple's native CFPropertyList reader.

Problem and expected behavior

The decoder previously removed whitespace and passed the expanded XML text
directly to atob. This produced different results from native decoding for
incomplete Base64 values, punctuation, and XML character references.

For example:

  • AQID decodes to 010203
  • whitespace-separated A Q I D decodes to 010203
  • incomplete AQI produces empty data
  • AQ!ID is accepted as 010203
  • AQI&#33;D preserves the raw XML spelling used by native decoding

Change and scope

The shared XML plist boundary now:

  • Preserves the raw <data> source spelling before XML entity expansion, associated with each concrete DOM <data> node by source span.
  • Represents self-closing <data/> as an empty raw span and accepts whitespace before closing-tag >.
  • Removes non-Base64 characters from the raw spelling.
  • Decodes only complete Base64 quartets.
  • Preserves the existing raw source, Evidence, and projection behavior.

Added regression coverage for valid, whitespace-separated, incomplete,
punctuation-containing, and XML-entity-containing data values.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Shared XML plist <data> decoding.
  • CLI and MCP/tool-catalog contract: No changes.
  • Provider or platform compatibility: Aligns behavior with native
    CFPropertyList; no provider changes.
  • Evidence and provenance: Existing raw source and projection paths are
    preserved.
  • Maintainer scope decision: Not applicable; this is an existing runtime
    decoder fix.

Validation performed

  • npm run test:local -- src/domain/xmlDocument.test.ts src/domain/propertyListXml.test.ts src/native/parsers/plist.test.ts - 85 tests passed.
  • npm run check:fast - passed.
  • npx oxfmt --check src/domain/xmlDocument.ts src/domain/propertyListXml.ts src/domain/propertyListXml.test.ts src/native/parsers/plist.test.ts - passed.
  • git diff --check - passed.

Compiled boundary and real-provider workflows were not run.

Compatibility and safety

  • No breaking API or migration changes.
  • No target execution, process interaction, instrumentation, or sensitive-data
    handling was added.
  • No generated metadata or package changes are required.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5014 **Author:** [@therahimulislam](https://github.com/therahimulislam) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/4978-plist-data-decoding` --- ### 📝 Commits (2) - [`bef1042`](https://github.com/morluto/rea/commit/bef10426d5127889131014490e8875fcbf6498f4) fix(plist): match native data decoding - [`7f94894`](https://github.com/morluto/rea/commit/7f94894e618e6721dedc4e34e992ddd99a4d7d6c) fix(plist): preserve raw data spelling ### 📊 Changes **4 files changed** (+67 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/propertyListXml.test.ts` (+13 -0) 📝 `src/domain/propertyListXml.ts` (+10 -1) 📝 `src/domain/xmlDocument.ts` (+29 -9) 📝 `src/native/parsers/plist.test.ts` (+15 -0) </details> ### 📄 Description ## Summary Fixes #4978. This updates XML plist `<data>` decoding to match the behavior observed from Apple's native `CFPropertyList` reader. ## Problem and expected behavior The decoder previously removed whitespace and passed the expanded XML text directly to `atob`. This produced different results from native decoding for incomplete Base64 values, punctuation, and XML character references. For example: - `AQID` decodes to `010203` - whitespace-separated `A Q I D` decodes to `010203` - incomplete `AQI` produces empty data - `AQ!ID` is accepted as `010203` - `AQI&#33;D` preserves the raw XML spelling used by native decoding ## Change and scope The shared XML plist boundary now: - Preserves the raw `<data>` source spelling before XML entity expansion, associated with each concrete DOM `<data>` node by source span. - Represents self-closing `<data/>` as an empty raw span and accepts whitespace before closing-tag `>`. - Removes non-Base64 characters from the raw spelling. - Decodes only complete Base64 quartets. - Preserves the existing raw source, Evidence, and projection behavior. Added regression coverage for valid, whitespace-separated, incomplete, punctuation-containing, and XML-entity-containing data values. ## Contract and boundary impact - Semantic owner and earliest changed stage: Shared XML plist `<data>` decoding. - CLI and MCP/tool-catalog contract: No changes. - Provider or platform compatibility: Aligns behavior with native `CFPropertyList`; no provider changes. - Evidence and provenance: Existing raw source and projection paths are preserved. - Maintainer scope decision: Not applicable; this is an existing runtime decoder fix. ## Validation performed - `npm run test:local -- src/domain/xmlDocument.test.ts src/domain/propertyListXml.test.ts src/native/parsers/plist.test.ts` - 85 tests passed. - `npm run check:fast` - passed. - `npx oxfmt --check src/domain/xmlDocument.ts src/domain/propertyListXml.ts src/domain/propertyListXml.test.ts src/native/parsers/plist.test.ts` - passed. - `git diff --check` - passed. Compiled boundary and real-provider workflows were not run. ## Compatibility and safety - No breaking API or migration changes. - No target execution, process interaction, instrumentation, or sensitive-data handling was added. - No generated metadata or package changes are required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6733
No description provided.