Skip to content

bun run desktop aborts when a VoiceStudio-managed backend still holds port 3900 #1974

Description

@tinhochu

What happens

Run bun run desktop, kill only the app window (or hit a shell crash) so the backend the Tauri shell spawned from its managed venv (~/Library/Application Support/com.debpalash.omnivoice-studio/project/.venv/...) is left running on port 3900. Run bun run desktop again and the predesktop hook dies:

error: Refusing to stop unrelated process <pid>
    at clearDevPortsWith (scripts/clear-dev-ports.mjs:260:29)

The launch never starts. The orphan also survives bun run desktop-prod / installed-app / tauri dev-without-TAURI_SKIP_BACKEND runs.

Root cause

scripts/clear-dev-ports.mjs only treats a port holder as ours when it runs out of the git checkout (belongsToCheckout()). A backend running from the Tauri-managed app directory (com.debpalash.omnivoice-studio) is namespaced just as unambiguously but isn't recognized, so the script refuses to reclaim the port instead of freeing it.

Same class as #1941 (which fixed the Windows stop path) — this is the ownership check, on every platform.

Fix

Recognize a listener as VoiceStudio-owned when its executable path or command line contains the reverse-DNS bundle id com.debpalash.omnivoice-studio, in addition to the checkout-path test. Regression tests in tests/frontend/clearDevPorts.test.mjs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions