Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature] Metro cache cleanup uses blocking and unsafe recursive deletion

オープン 初心者向け
#3,006 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript, vscode
領域
devtools, tooling

調査の方向性

拡張機能のソース内で「Clean & Restart Packager」コマンドと、そのカスタムメソッド deleteDirectory() を見つけてください。まずクリーンアップの流れとエラー処理を読み、packager が再起動する前にクリーンアップが完了すること、およびキャッシュパスが存在しない場合に処理されることを確認してください。issue にはファイル名やテスト名が記載されていないため、リポジトリ内で該当するコマンドとテストを探してください。

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

説明

enhancement

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

環境構築

はじめの一歩

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

microsoft/vscode-react-native のほかの issue

microsoft/vscode-react-native の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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