react / react/react-native

Reentrant structuredClone breaks outer circular references

オープン
#58,204 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Needs: Author Feedback Needs: Repro
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

The React Native structuredClone polyfill reuses one module-global memory map under the assumption that cloning does not invoke user code. Enumerable property getters do execute, however, and can call structuredClone recursively. The inner call's finally clears the outer clone's memory, so later circular references are cloned again instead of pointing to the outer result.

Expected behavior

Each reentrant clone should have independent cycle-detection memory, while ordinary non-reentrant calls may retain the existing reusable-map optimization.

React Native Version

0.87.1 and current main

Affected Platforms

JavaScript runtime - All

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、React Native structuredClone polyfill と、その循環検出におけるメモリ処理を特定します。列挙可能な getter から、外側に循環参照を持つネストされたクローンを再現し、その後、再入可能な呼び出しが独立したメモリを使用する一方で、通常のクローンが従来の動作を維持することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react-native
領域
mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
62/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。