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

Windows sandbox: a command that fails before starting leaves sandbox-helper.exe running

Chiusa Adatta ai principianti
#162 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust, typescript
Ambito
desktop, testing

Direzione di ricerca

Inizia con HelperProcess.fail() in src/main/tools/sandbox_windows.ts e il test del fake helper in sandbox_windows.test.ts:291; confronta il comportamento del vero helper all’EOF di stdin in native/sandbox-helper/src/win.rs:216-252. Aggiorna il fake helper affinché resti attivo finché stdin non viene chiuso, quindi verifica che l’helper termini dopo fail() ed esegui i test del sandbox Windows.

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

Descrizione

bug platform: windows priority: high severity: high

Found in the 2026-10-07 code review (traced on both the TypeScript and Rust sides).

Problem

HelperProcess.finish() (src/main/tools/sandbox_windows.ts:365-377) ends the helper's stdin, but fail() (:356-363) does not. The helper's serve loop (native/sandbox-helper/src/win.rs:216-252) only exits when stdin reaches EOF. After run() returns Err, it sends Error{id} and waits for more input. ShellRunner treats 'error' as finished and never calls killTree. Background entries get exitCode = null, so stopBackground skips them too.

Scenario

Every error before the command starts leaves one idle helper process with three pipes: a lock timeout, missing git metadata, a CreateAppContainerProfile/CreateProcessW failure, no free drive letter, or a cancel during preparation. A model that retries a failing command piles them up until Patch quits.

Why the tests miss it

The fake helper in sandbox_windows.test.ts:291 calls process.exit(0) after sending error. The real helper doesn't exit.

Fix

private fail(message: string): void {
  if (this.done) return;
  this.done = true;
  this.helper.stdin?.end();   // the helper exits once its input closes
  this.stdout.end();
  this.stderr.end();
  this.emit('error', new Error(message));
  this.emit('close', null);
}

Make the fake helper stay alive until its stdin closes, and assert that the helper process exited after fail().

Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
8h 28m
PR unite (30g)
26

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 PierrunoYT/patch

Tutte le issue di PierrunoYT/patch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.