[PR #2099] [MERGED] fix(browser): compare PNG IHDR bytes without ASCII folding #5028

Closed
opened 2026-10-31 00:59:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2099
Author: @fisforfaheem
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @baron

Base: main ← Head: fix/compare-png-ihdr-without-ascii-folding


📝 Commits (3)

  • 847d642 fix(browser): compare PNG IHDR bytes without ASCII folding
  • d4d8919 fix(browser): satisfy the strict index check in the IHDR test
  • e1df05b refactor(browser): share byte-faithful PNG header facts

📊 Changes

5 files changed (+88 additions, -28 deletions)

View changed files

📝 src/browser/CdpScreenshot.ts (+4 -19)
📝 src/domain/native/nativeUiObservation.ts (+5 -9)
➕ src/domain/pngHeader.test.ts (+35 -0)
➕ src/domain/pngHeader.ts (+17 -0)
📝 src/native/NativeUiObservation.test.ts (+27 -0)

📄 Description

Summary

  • Screenshot validation already compares the PNG signature as raw bytes, then decoded the following chunk type with Buffer.toString("ascii").
  • Compare the four IHDR bytes with Buffer.equals in native UI snapshots and CDP screenshot capture, so a high-bit chunk type is not accepted as IHDR.

Test plan

  • npm run test:focused -- src/native/NativeUiObservation.test.ts
  • Pre-push typecheck and lint

Made with Cursor


🔄 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/2099 **Author:** [@fisforfaheem](https://github.com/fisforfaheem) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@baron](https://github.com/baron) **Base:** `main` ← **Head:** `fix/compare-png-ihdr-without-ascii-folding` --- ### 📝 Commits (3) - [`847d642`](https://github.com/morluto/rea/commit/847d64280a9f40868ecf8f71f6fe4adc401444c6) fix(browser): compare PNG IHDR bytes without ASCII folding - [`d4d8919`](https://github.com/morluto/rea/commit/d4d8919172879e5f2170e6042f6c8eb475069bf1) fix(browser): satisfy the strict index check in the IHDR test - [`e1df05b`](https://github.com/morluto/rea/commit/e1df05b6cfebd091c87e60594759d1bdd5e57e1c) refactor(browser): share byte-faithful PNG header facts ### 📊 Changes **5 files changed** (+88 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/CdpScreenshot.ts` (+4 -19) 📝 `src/domain/native/nativeUiObservation.ts` (+5 -9) ➕ `src/domain/pngHeader.test.ts` (+35 -0) ➕ `src/domain/pngHeader.ts` (+17 -0) 📝 `src/native/NativeUiObservation.test.ts` (+27 -0) </details> ### 📄 Description ## Summary - Screenshot validation already compares the PNG signature as raw bytes, then decoded the following chunk type with `Buffer.toString("ascii")`. - Compare the four `IHDR` bytes with `Buffer.equals` in native UI snapshots and CDP screenshot capture, so a high-bit chunk type is not accepted as IHDR. ## Test plan - [x] `npm run test:focused -- src/native/NativeUiObservation.test.ts` - [x] Pre-push `typecheck` and `lint` Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:59:00 +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#5028
No description provided.