[PR #4054] [CLOSED] fix(plist): preserve CDATA real values (#4042) #6024

Closed
opened 2026-10-31 01:11:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4054
Author: @Abrar090909
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/4042-plist-real-cdata


📝 Commits (1)

  • e14f795 fix(plist): preserve CDATA real values

📊 Changes

4 files changed (+100 additions, -4 deletions)

View changed files

📝 src/artifacts/apple/KeyedArchiveReader.test.ts (+26 -0)
📝 src/artifacts/apple/KeyedArchiveReader.ts (+4 -1)
📝 src/domain/propertyListKeys.ts (+51 -1)
📝 tests/fixtures/keyedArchiveNumberMetadata.ts (+19 -2)

📄 Description

Fixes #4042

Problem

A valid XML plist <real> whose content is split across text and CDATA decoded to the wrong value in keyed-archive inspection: <real>1<![CDATA[.25]]></real> returned 1, and <real><![CDATA[1.25]]></real> returned {"$plist_type":"real","value":null}. The expected value in both cases is 1.25.

Cause

The pinned plist@5.0.0 real decoder concatenates only text nodes, and REA's separate XML number scanner treated real CDATA as incomplete.

Fix

Direct <real> CDATA nodes are normalized to equivalent escaped text at the shared XML decoding boundary, and keyed-archive decoding passes that same representation to both the decoder and the scanner. Integer, key, and other behavior is unchanged.

Tests

New regression cases in src/artifacts/apple/KeyedArchiveReader.test.ts (plus fixture additions) cover the plain, mixed text+CDATA, and pure-CDATA reals. Before the fix, the mixed case failed with expected 1.25, received 1 and the pure-CDATA case failed with null; after the fix both pass.

  • Source tests: 2 files, 60 tests passed
  • Filesystem / built CLI / MCP tests: 2 files, 48 tests passed
  • Lint: 0 errors. Typecheck: passed.

Limitations

  • I did not run the full suite; it takes about 26 minutes and has about 1,249 pre-existing failures on a clean Windows checkout, so only targeted tests were run.
  • Validated on Windows with Node 24.20.0 / npm 11.19.0 instead of the pinned 24.18.0 / 11.16.0.
  • The plutil comparison from the issue was not reproduced (no macOS available); the reproduction here uses inline XML.
  • This touches the same XML decoding boundary as #3426 and #3475, so a rebase may be needed depending on merge order.

🔄 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/4054 **Author:** [@Abrar090909](https://github.com/Abrar090909) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/4042-plist-real-cdata` --- ### 📝 Commits (1) - [`e14f795`](https://github.com/morluto/rea/commit/e14f79589fa8e5198f68b58cc1e805401aceb5a9) fix(plist): preserve CDATA real values ### 📊 Changes **4 files changed** (+100 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/apple/KeyedArchiveReader.test.ts` (+26 -0) 📝 `src/artifacts/apple/KeyedArchiveReader.ts` (+4 -1) 📝 `src/domain/propertyListKeys.ts` (+51 -1) 📝 `tests/fixtures/keyedArchiveNumberMetadata.ts` (+19 -2) </details> ### 📄 Description Fixes #4042 ## Problem A valid XML plist `<real>` whose content is split across text and CDATA decoded to the wrong value in keyed-archive inspection: `<real>1<![CDATA[.25]]></real>` returned `1`, and `<real><![CDATA[1.25]]></real>` returned `{"$plist_type":"real","value":null}`. The expected value in both cases is `1.25`. ## Cause The pinned `plist@5.0.0` real decoder concatenates only text nodes, and REA's separate XML number scanner treated real CDATA as incomplete. ## Fix Direct `<real>` CDATA nodes are normalized to equivalent escaped text at the shared XML decoding boundary, and keyed-archive decoding passes that same representation to both the decoder and the scanner. Integer, key, and other behavior is unchanged. ## Tests New regression cases in `src/artifacts/apple/KeyedArchiveReader.test.ts` (plus fixture additions) cover the plain, mixed text+CDATA, and pure-CDATA reals. Before the fix, the mixed case failed with `expected 1.25, received 1` and the pure-CDATA case failed with `null`; after the fix both pass. - Source tests: 2 files, 60 tests passed - Filesystem / built CLI / MCP tests: 2 files, 48 tests passed - Lint: 0 errors. Typecheck: passed. ## Limitations - I did not run the full suite; it takes about 26 minutes and has about 1,249 pre-existing failures on a clean Windows checkout, so only targeted tests were run. - Validated on Windows with Node 24.20.0 / npm 11.19.0 instead of the pinned 24.18.0 / 11.16.0. - The `plutil` comparison from the issue was not reproduced (no macOS available); the reproduction here uses inline XML. - This touches the same XML decoding boundary as #3426 and #3475, so a rebase may be needed depending on merge order. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:11:15 +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#6024
No description provided.