console Chrome never outlives its run: exit kills it, SIGINT / SIGTERM / SIGHUP close it gracefully, a detached watchdog ends it when the parent dies (SIGKILL included; a reused pid is never killed); every start ends headless orphans on storebound profiles and names orphaned windows; headless runs on macOS prefer Chromium / Chrome for Testing over Google Chrome.app (an orphan kept the owner's Chrome from opening from the Dock); console fill closes the window on errors; pitfall 68; tests

This commit is contained in:
CRTkafa 2026-10-15 00:28:32 +08:00
parent b350781ab5
commit 89d94d6993
10 changed files with 372 additions and 17 deletions

View file

@ -779,3 +779,18 @@ that fails without the fix (see CONTRIBUTING.md).
- **Guard:** `checkoutInfo`, `builtIpaEntitlements` (cli/apple/signing.ts), `machoEntitlements`,
`compareCapabilities` (cli/lib/signing.ts), `tests/signing-capabilities.test.ts` (entitlements only on another
branch; IPAs with entitlements).
## 68. The owner's Chrome would not open: an orphaned headless storebound Chrome
- **Symptom:** clicking Chrome in the Dock does nothing (no window); `ps` shows a Chrome with
`--user-data-dir=…storebound-profile-…` (or `…/.storebound/console-profile/…`, `storebound-chrome-…`),
`--remote-debugging-port=0 --headless=new` and parent PID 1.
- **Cause:** a Chrome storebound started for a console flow (here a test run) outlived its run. Started with a
DevTools port, Chrome does not notice its parent dying; macOS LaunchServices then counts the windowless instance
as the running "Google Chrome", so the Dock only activates it.
- **Do:** run any `storebound console …` command (or `bun test tests/chrome-guard.test.ts`): every start ends such
headless orphans and names orphaned windows. By hand: `kill <pid>` of the process without `--type=`. Never kill a
Chrome whose parent is a running storebound (a run that waits for its window), or the owner's own Chrome.
- **Guard:** `guardChrome` / `startWatchdog` / `reapStaleChromes` (cli/console/chrome-guard.ts): exit, Ctrl+C,
SIGTERM / SIGHUP and the parent's death (SIGKILL included) end the Chrome; `console fill` closes it on errors too;
headless runs on macOS prefer Chromium / Chrome for Testing (its own bundle id) over Google Chrome.app
(`persistentExecutable`); `tests/chrome-guard.test.ts`.