fix(dev): point SPA API proxy at server:8080 not 4301 #382

Merged
longjacksonle merged 1 commit from fix/dev-server-proxy-port into main 2026-06-30 04:27:36 +02:00

Problem

While smoke-testing on the live dev stack, every screen was slow and no data loaded or saved. The dx dev-server logs showed a flood of:

ERROR Proxy error: Backend not ready after 30s: Connection refused (os error 111) on every /api/v1/* request.

Root cause

The [[web.proxy]] backend in Dioxus.toml targeted http://server:4301/api/, but the mokosh-server container listens on its $MOKOSH_PORT (8080). Port 4301 is the SPA dev-server's own port, not the API port. So the proxy connected to a port nothing was listening on, got connection-refused, and timed out after 30s. Net effect: the SPA could not reach the backend at all, so lists 500'd and form saves (including the Billable / timesheet-certify checkboxes that were under investigation) silently failed.

Verified from the apps container: wget http://server:8080/api/v1/health returns OK; server:4301 is refused.

Fix

Point the proxy at http://server:8080/api/ to match the server's actual listen port. Comment updated to record that 8080 is the API port and 4301 is the SPA dev port.

Note

This unblocks in-browser testing of the merged PMS-571 checkbox fix (#381): the checkboxes appeared broken in part because no save request was reaching the backend. With the proxy corrected we can finally observe the real checkbox behavior.

## Problem While smoke-testing on the live dev stack, every screen was slow and no data loaded or saved. The dx dev-server logs showed a flood of: `ERROR Proxy error: Backend not ready after 30s: Connection refused (os error 111)` on every `/api/v1/*` request. ## Root cause The `[[web.proxy]]` backend in `Dioxus.toml` targeted `http://server:4301/api/`, but the mokosh-server container listens on its `$MOKOSH_PORT` (8080). Port 4301 is the SPA dev-server's own port, not the API port. So the proxy connected to a port nothing was listening on, got connection-refused, and timed out after 30s. Net effect: the SPA could not reach the backend at all, so lists 500'd and form saves (including the Billable / timesheet-certify checkboxes that were under investigation) silently failed. Verified from the apps container: `wget http://server:8080/api/v1/health` returns OK; `server:4301` is refused. ## Fix Point the proxy at `http://server:8080/api/` to match the server's actual listen port. Comment updated to record that 8080 is the API port and 4301 is the SPA dev port. ## Note This unblocks in-browser testing of the merged PMS-571 checkbox fix (#381): the checkboxes appeared broken in part because no save request was reaching the backend. With the proxy corrected we can finally observe the real checkbox behavior.
fix(dev): point SPA API proxy at server:8080 not 4301
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m23s
Create release / Create release from merged PR (pull_request) Has been skipped
8525a42009
The dx dev-server reverse-proxy for /api/* targeted http://server:4301, but the mokosh-server container listens on its $MOKOSH_PORT (8080); 4301 is the SPA dev-server port, not the API port. With the wrong port every /api/* request got "Connection refused" and timed out after 30s, so the running SPA could not load or persist any data (every list 500'd, and form saves like the Billable/certify checkboxes silently failed). Point the proxy at server:8080 to match the server's actual listen port.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/dev-server-proxy-port 2026-06-30 04:27:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!382
No description provided.