Skip to content

Register WebSocket route under the path prefix too#89

Merged
maximusunc merged 1 commit into
mainfrom
claude/monitoring-dashboard-worker-Tt4X7
May 18, 2026
Merged

Register WebSocket route under the path prefix too#89
maximusunc merged 1 commit into
mainfrom
claude/monitoring-dashboard-worker-Tt4X7

Conversation

@maximusunc
Copy link
Copy Markdown
Collaborator

Some nginx-ingress configurations don't preserve the WebSocket Upgrade header when rewrite-target is active -- the upgrade becomes a plain HTTP GET by the time it reaches uvicorn, so the @APP.websocket('/ws') route never matches and FastAPI returns 404.

The companion fix is a separate ingress that routes /<prefix>/ws to the monitor service without rewrite-target, so the Upgrade headers pass through. This commit registers the WS handler at the prefixed path as well, so the route table matches regardless of whether the ingress rewrote the path.

Local dev (no MONITOR_ROOT_PATH) only adds the bare /ws entry.

Some nginx-ingress configurations don't preserve the WebSocket
``Upgrade`` header when ``rewrite-target`` is active -- the upgrade
becomes a plain HTTP GET by the time it reaches uvicorn, so the
``@APP.websocket('/ws')`` route never matches and FastAPI returns 404.

The companion fix is a separate ingress that routes ``/<prefix>/ws`` to
the monitor service *without* rewrite-target, so the Upgrade headers
pass through. This commit registers the WS handler at the prefixed
path as well, so the route table matches regardless of whether the
ingress rewrote the path.

Local dev (no MONITOR_ROOT_PATH) only adds the bare ``/ws`` entry.
@maximusunc maximusunc merged commit c2cf2a3 into main May 18, 2026
2 checks passed
@maximusunc maximusunc deleted the claude/monitoring-dashboard-worker-Tt4X7 branch May 18, 2026 17:22
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.16%. Comparing base (efb831b) to head (6093c60).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
workers/monitor/worker.py 0.00% 5 Missing ⚠️
Files with missing lines Coverage Δ
workers/monitor/worker.py 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e451102...6093c60. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants