mediago-dev--mediago
28e2c58366
If a stray MediaGo instance (typically the installed Desktop build running in the background from the Start menu) already holds the preferred port, a freshly-spawned child fails to bind and exits immediately — but `waitForHealthy()` happily answers green because the *other* instance's `/healthy` responds on the same port. ServiceRunner then considers the service "started" and every subsequent request silently lands on the wrong process. In practice this surfaced as dev mode talking to the installed Go Core and reporting a stale gopeed binary path, even though the dev build had already been rebuilt with aria2c. Pre-check: before spawning, open and close a throwaway TCP listener on `<bindHost>:<preferredPort>`. If the bind fails, throw a human-readable error instead of proceeding. The tiny check-vs-bind race window is acceptable for catching the real-world "long-running stray instance" case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tsdown-starter
A starter for creating a TypeScript package.
Development
- Install dependencies:
npm install
- Run the unit tests:
npm run test
- Build the library:
npm run build