Skip to content

fix(cli): clear connection timeout timer to prevent 5s exit delay#9

Merged
dkisser merged 2 commits into
mainfrom
fix/cli-exit-delay
Jun 23, 2026
Merged

fix(cli): clear connection timeout timer to prevent 5s exit delay#9
dkisser merged 2 commits into
mainfrom
fix/cli-exit-delay

Conversation

@dkisser

@dkisser dkisser commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Usage: bridge [args]

Commands:
up Start ws-server and local-proxy
down Stop both services
restart down then up
status Show service state
logs [name] Tail logs (ws-server | local-proxy)
update [version] Upgrade to a release (default: latest)
doctor Diagnose the install
uninstall Remove ~/.browser-bridge/ (use --yes to skip prompt)
version Print installed + latest version

Browser commands (when services are running and a browser is connected):
browser:list List connected browsers
navigate Open a URL in the current tab
click Click an element
type Type text into an element
screenshot Take a screenshot
See 'bridge --help' for the full list. CLI commands that open a WebSocket connection were hanging for ~5 seconds after printing output. The connection-timeout +setTimeout+ was never cleared once the socket reached the OPEN state, so Bun kept the process alive until the timer expired.

Changes

  • Save the connection timeout handle in +listBrowsers+ and +sendCommand+ and +clearTimeout+ it as soon as the socket opens.
  • Remove the stray +console.log('Connected to server')+ from the WebSocket client.

Verification

  • +time bun apps/cli/src/index.ts browser:list+: dropped from ~5.0s to ~90ms.
  • +time bun apps/cli/src/index.ts --browser <id> pageinfo+: dropped from ~5.0s to ~90ms.
  • +bun run type-check+: passes.
  • +bun test+: 49 pass, 0 fail.

Test Plan

  • Manual timing of +browser:list+ and +pageinfo+
  • Type check
  • Unit test suite

dkisser added 2 commits June 23, 2026 13:28
…eval

- Introduced a new section on extraction strategy emphasizing text-based extraction over screenshots.
- Provided detailed steps on when to use `gettext` or `gethtml` and when to fall back to `screenshot` for better efficiency and clarity.
@dkisser dkisser merged commit 6070574 into main Jun 23, 2026
1 check passed
@dkisser dkisser deleted the fix/cli-exit-delay branch June 23, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant