[Feature] Metro cache cleanup uses blocking and unsafe recursive deletion
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript, vscode
調査の方向性
拡張機能のソース内で「Clean [31m&[0m Restart Packager」コマンドと、そのカスタムメソッド deleteDirectory() を見つけてください。まずクリーンアップの流れとエラー処理を読み、packager が再起動する前にクリーンアップが完了すること、およびキャッシュパスが存在しない場合に処理されることを確認してください。issue にはファイル名やテスト名が記載されていないため、リポジトリ内で該当するコマンドとテストを探してください。
索引モデルが issue の本文から書いたものです。
説明
Problem
The “Clean & Restart Packager” command currently deletes the Metro cache using a custom recursive deleteDirectory() method.
This implementation has several issues:
- It uses synchronous filesystem APIs inside an asynchronous workflow, potentially blocking the extension host when the cache contains many files.
statSync()follows symbolic links, so recursive traversal may delete files in directories outside the Metro cache.- Separate existence checks and deletion operations introduce time-of-check/time-of-use (TOCTOU) races.
- It duplicates functionality already provided by Node.js.
Proposed solution
Replace the existence check and custom recursive deletion with:
await fs.promises.rm(metroCachePath, {
recursive: true,
force: true,
});
Remove the unused deleteDirectory() method and preserve the existing error handling.
Expected behavior
- Metro cache cleanup does not use synchronous filesystem APIs.
- Symbolic links inside the cache are removed without deleting their target contents.
- A missing cache directory does not cause cleanup to fail.
- The packager restarts after cleanup completes.
- 主要言語
- TypeScript
- スター
- 2.7k
- フォーク
- 298
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/vscode-react-native のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/vscode-react-native#3011 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/vscode-react-native#3008 ·
メンテナーはふだん 1 日以内に返信
-
[Feature] Avoid duplicate error notifications対応中かも @erenbati が 12 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/vscode-react-native#2963 ·
メンテナーはふだん 1 日以内に返信
-
[Feature] Stop Expo Go installation when Quick Pick is canceled対応中かも @erenbati が 27 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/vscode-react-native#2959 ·
メンテナーはふだん 1 日以内に返信
-
enhancement follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/vscode-react-native#2951 ·
メンテナーはふだん 1 日以内に返信
microsoft/vscode-react-native の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Nimblesite/SharpLsp#468 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Bundled uv is never updated and trusts the compromised eMudhra certificates対応中かも @FabienDanieau が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bg_wait's blocking mode (stopOnAttention: false) is under-documented and effectively undiscoverableオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
nicobailon/pi-subagents#3019 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
db-ux-design-system/core-web#8613 ·
メンテナーはふだん 1 日以内に返信