fix(portless): avoid route collisions across worktrees

This commit is contained in:
Tommaso Casaburi
2026-03-30 17:32:01 +07:00
parent 75958ac0c5
commit 8078d10441
5 changed files with 75 additions and 5 deletions
+10
View File
@@ -67,3 +67,13 @@ If uncertain, ask the developer before adding an entry.
- **Impact:** Contributors could lose the fallback dev path or interrupt their startup flow when `1355` was already busy.
- **Mitigation:** Keep the fallback behind `scripts/start-dev.js`, which now probes from `1355` upward and starts Vite on the next free port instead of exiting.
- **Status:** confirmed
### Fixed Portless app names collide across 5chan worktrees
- **Date:** 2026-03-30
- **Observed by:** Codex
- **Context:** Starting `yarn start` in one 5chan worktree while another 5chan worktree was already serving through Portless
- **What was surprising:** Using the literal Portless app name `5chan` in every worktree makes the route itself collide, even when the backing ports are different, so the second process fails with `"5chan.localhost" is already registered`.
- **Impact:** Parallel 5chan branches can block each other even though Portless is meant to let them coexist safely.
- **Mitigation:** Keep Portless startup behind `scripts/start-dev.js`, which now uses a branch-scoped `*.5chan.localhost:1355` route outside the canonical case and falls back to a branch-scoped route when the bare `5chan.localhost` name is already occupied.
- **Status:** confirmed