Skip to content

fix(ui): map sensing websocket port for docker#572

Merged
ruvnet merged 1 commit into
ruvnet:mainfrom
therahul-yo:fix-511-sensing-ws-port
May 17, 2026
Merged

fix(ui): map sensing websocket port for docker#572
ruvnet merged 1 commit into
ruvnet:mainfrom
therahul-yo:fix-511-sensing-ws-port

Conversation

@therahul-yo
Copy link
Copy Markdown
Contributor

@therahul-yo therahul-yo commented May 15, 2026

Summary

  • Map the web UI sensing WebSocket URL from Docker HTTP port 3000 to WS port 3001.
  • Preserve the Python sensing stack mapping from UI port 8080 to WS port 8765.
  • Guard WebSocket event handlers against stale or unregistered connection records so late messages do not throw on lastActivity.
  • Add a UI regression test covering the reported LAN/Docker port mapping.

Validation

  • git diff --check
  • node --check ui/services/sensing.service.js
  • node --check ui/services/websocket.service.js
  • node --check ui/tests/test-runner.js
  • Browser UI test runner: 26/26 passed

Fixes #511

Copy link
Copy Markdown
Owner

@ruvnet ruvnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff:

  • buildSensingWsUrl() correctly handles the two documented deployment shapes (Docker 3000→3001, Python 8080→8765). For unrecognized HTTP ports the function falls back to window.location.host, preserving same-port behaviour for any custom setup.
  • getConnection(eventName) guard in websocket.service.js is the right fix for the race where a callback fires after the connection map entry has been cleaned up. Logging the warning with url + readyState makes the symptom observable.
  • New tests in test-runner.js exercise both the port-mapping logic and the cleanup race.
  • Default fallback host changed from localhost:3000 to localhost:3001 — that matches the sensing-server's WS port in the Docker image, which is the right default for the demo path. Anyone running a custom HTTP+WS-on-same-port stack still works via the location fallback.

Approving + merging.

@ruvnet ruvnet merged commit 4698f54 into ruvnet:main May 17, 2026
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.

Live Human Pose Detection websocket connection failed

2 participants