Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

filesystem: list_directory_with_sizes reports an entry it could not stat as 0 B

Aperta
#5,190 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start with list_directory_with_sizes in src/filesystem/server.ts and the pinned behavior in src/filesystem/__tests__/server-tools.test.ts; the prior PR #4911 is identified as a prototype. Check how failed stat calls are handled and how the combined size is calculated. Done when an entry that cannot be stat'd is reported as unknown or as a failure and is excluded from the total, with tests covering the behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug server-filesystem v2
Problem

The list_directory_with_sizes handler in src/filesystem/server.ts catches a failed stat on an entry and substitutes a size of 0 and an mtime of the epoch. An unreadable entry, a dangling symlink, or a file removed between readdir and stat is therefore listed as 0 B and counted in the combined size, which makes it look like an empty file. src/filesystem/__tests__/server-tools.test.ts pins this behavior.

Expected

An entry that could not be stat'd is shown as unknown (or the failure is reported), rather than given an invented size, and is left out of the total. Any change to how this handler stats entries should be coordinated with other open work on the same handler.

Prior work
  • #4911 by @feiiiiii5

The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.

Lingua principale
TypeScript
Stelle
91.4k
Fork
11.8k
Merge medio
6h 39m
PR unite (30g)
146

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.