Files
hyperframes/packages
Miguel Ángel 0d202ea779 fix(cli): keep doctor resilient to a corrupt browser cache (#1822)
* fix(cli): keep doctor resilient to a corrupt browser cache

A partial or corrupt browser cache (a stub file where a version directory
is expected, a missing executable, or malformed metadata) makes
getInstalledBrowsers throw ENOTDIR. That throw propagated up through
findBrowser -> checkChrome -> runEnvironmentChecks, and since doctor.run
calls runEnvironmentChecks before any try/catch or the --json output, the
command crashed with exit 1.

doctor --json is documented to exit 0 even when checks fail, so it must
report a corrupt cache as "Chrome not found", not crash on it.

- checkChrome now catches any error from findBrowser and converts it to the
  existing ok:false "Chrome not found" outcome with the browser ensure hint,
  so runEnvironmentChecks never throws for a missing or corrupt browser.
- findFromCache treats a throwing getInstalledBrowsers as "no cached
  browser", letting resolution fall through to system/download instead of
  crashing every caller (render included), not just doctor.

A healthy browser still reports ok:true. Adds a preflight test asserting an
ok:false Chrome outcome when discovery throws, instead of propagating.

* fix(cli): warn on corrupt browser cache fallback
2026-06-30 20:49:10 -07:00
..
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-16 13:16:09 -04:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00
2026-06-30 14:49:36 -07:00