structuredClone loses ArrayBuffer and typed-array data
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 127k
- Forks
- 25.3k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Description
The React Native structuredClone polyfill treats ArrayBuffer, DataView, and every typed array as arbitrary objects, returning plain objects that lose their internal bytes, view type, offsets, lengths, and shared backing-buffer relationships.
Expected behavior
ArrayBuffers should be copied through the intrinsic operation; DataView and all supported typed-array kinds should be reconstructed with their original offset/length and should share the same cloned backing buffer when cloned together. User-shadowed slice or constructor properties must not be invoked. Transfer support is outside this issue.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the structuredClone polyfill on current main and first reproduce the issue with ArrayBuffer, DataView, and typed arrays, including shared backing buffers and shadowed properties. Trace the existing object-cloning path and its tests. Done means these built-in views retain their bytes, type, offsets, lengths, and relationships without invoking shadowed slice or constructor properties; transfer support remains out of scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100