git calls in the tree/file-browser crash with ENOBUFS on large repos
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- git, node.js, typescript
調査の方向性
dist/index.js で、getTreeEntries、getTreeFingerprint、git status --porcelain -u、git rev-parse --show-toplevel が使用している git 呼び出しから始めます。git ls-files | wc -c を使って、追跡対象のパスが 1 MB を超えるリポジトリで再現し、その後 diffity tree または /api/tree を実行します。大規模なリポジトリで ENOBUFS や 500 レスポンスが発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
Open diffity tree (or any tour view) on a large repo and the whole UI goes down with:
Something went wrong
Failed to get tree: Error: spawnSync git ENOBUFS
/api/tree returns a 500. Since the SPA surfaces that at the top level, views that don't even need the file tree (a code tour) go down with it too.
What I found
The git calls behind the file browser run through execFileSync("git", [...], { encoding: "utf-8" }) with no maxBuffer, so they get Node's 1 MB default. Once git ls-files prints more than 1 MB of paths, the call throws ENOBUFS. In 0.9.5's dist/index.js it's the git ls-files calls in getTreeEntries and getTreeFingerprint, the git status --porcelain -u, and the git rev-parse --show-toplevel calls.
How to reproduce
Any repo whose tracked paths exceed ~1 MB of text. Mine is a monorepo that vendors a few external repos as git subtrees, so git ls-files is ~14,300 files / 1.24 MB, just over the line. A large public repo would do the same.
git ls-files | wc -c # > 1048576 reproduces it
Environment
- diffity 0.9.5
- node (system), macOS arm64
- 主要言語
- TypeScript
- スター
- 775
- フォーク
- 57
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nilbuild/diffity のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
LSP for typescript オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
nilbuild/diffity の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100