Repository navigation
fix(dev): clear "can't reach the API" message; start-api refuses a busy port (#118) - #125
Merged
Merged
Conversation
…sy port (#118) - callApi() in session.ts: a network failure becomes "Can't reach the API at <base>. Is it running?"; aborts pass through. Used by sign-in, sign-out, change password and every apiFetch call. - start-api.ps1: if port 8000 is already listening, print the PID, its start time and the taskkill line, and exit 1 instead of starting a second API that never serves requests. - Both start scripts title their windows (API / Frontend). - QUICKSTART troubleshooting: two new rows; drop the stale "no Alembic in this repo" row (alembic.ini exists since #84). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YPoXzBSj89ZHgw7nfTmbB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #118. It doesn't close it: the cause of the 27 Oct silent API stop still needs evidence from the dev machine (see below).
What changes
callApi()insession.tsturns a network failure into "Can't reach the API at http://localhost:8000. Is it running?" instead of the browser's bare "Failed to fetch". Cancelled requests (AbortError) pass through unchanged. Sign-in, sign-out, change password and everyapiFetchcall use it.start-api.ps1taskkillline, then exits 1. On 27 Oct an API left over from 02:12 kept the port, and a new API printed "running" but never served a request.start-api.ps1andstart-frontend.ps1set their window titles to "API (port 8000)" and "Frontend (port 8080)", as the product owner asked on 27 Oct.QUICKSTART.mdalembic.ini not found… no Alembic in this repo" row is removed, becausealembic.inihas existed since #84.Checks
tscexit 0; eslint clean onsession.ts.pwshParser.ParseFile) and stay ASCII-only (BUG-021). The port check itself (Get-NetTCPConnection) is Windows-only, so it couldn't be run here. It needs the dev-machine check below.make lintexit 0. No Python changed.Still open on #118 (needs the dev machine)
.\scripts\start-api.ps1. It should print "Port 8000 is already in use by PID …" and exit.--reloadreacting to OneDrive syncs.Done when
Generated by Claude Code