Repository navigation
fix(runtime): recognize Buffers in typed-array predicates (#11239) - #11243
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughRuntime view predicates now recognize Buffer-backed typed arrays. The changes also add runtime assertions and a diagnostic test script for Buffer variants, typed arrays, and other backing types. ChangesBuffer view predicates
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The Buffer predicate fix appears ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #11239.
Node Buffers now return
truefromArrayBuffer.isView,util.types.isArrayBufferView,util.types.isUint8Array, andutil.types.isTypedArray, including extracted predicate calls. This restores the view check used by bson when accepting Buffer spans as UUID bytes.The util typed-array classifier and
ArrayBuffer.isViewthunk reuse the existing Buffer-backed typed-array brand helper. ArrayBuffer, SharedArrayBuffer, DataView, and crypto key objects keep their distinct brands.Validation:
perry-devcompiler plus runtime/stdlib archives; six native fixtures match Node 26.5.1 byte-for-byte: the new Buffer regression, typed arrays, typed-array prototype methods, generic annotations, DataView operations, and DataView backing aliasing.PERRY_NO_AUTO_OPTIMIZE=1; the full parity suite, auto-optimize lane, and live MongoDB integration were not run.Checked GitHub PRs, local worktrees, and worktrees on
root@perrymaster.skelpo.netbefore taking the issue; no competing fix was found. No version bump.Summary by CodeRabbit
ArrayBuffer.isViewand related type checks, including when those checks are called through extracted aliases.