Skip to content

Fix websocket connection#71

Merged
MaddieWright merged 1 commit intomainfrom
frontend/websocket-fix
Mar 11, 2026
Merged

Fix websocket connection#71
MaddieWright merged 1 commit intomainfrom
frontend/websocket-fix

Conversation

@MaddieWright
Copy link
Collaborator

@MaddieWright MaddieWright commented Mar 11, 2026

Fix websocket connection

What?

  • the filter node was opening its own separate WebSocket connection solely to send the processing config, while the signal graph node opened a different connection to receive data
  • the backend (handle_connection) always reads the first message as the processing config before starting the broadcast
  • so the signal graph's connection would hang indefinitely waiting for a config that never arrived on it

How?

  • removed useWebsocket(0, 0) from filter-node.tsx. Instead, the filter node dispatches a processing-config-update custom window event with the current config whenever streaming starts or filter settings change
  • added an event listener in useWebsocket that picks up processing-config-update events and forwards the config to the backend on the active connection
  • changed onopen in useWebsocket to always send a default passthrough config if no filter config has been set yet, ensuring the backend always receives a first message and starts broadcasting
  • fixed combo-box.tsx ignoring the lowCutoff/highCutoff/setLowCutoff/setHighCutoff props; the sliders were updating internal local state that was never passed back to the parent's buildConfig(), so filter cutoff values had no effect

Testing

  • confirmed Docker build succeeds for websocket-server after removing the Windows-only import
  • verified in browser console that "WebSocket connection opened." logs on stream start
  • confirmed no "Error parsing signal configuration JSON" errors appear in websocket-server logs
  • tested Source to Chart View pipeline: data flows to chart on stream start
  • tested Source to Filter to Chart View pipeline: data flows and filter type/cutoff changes dispatch config update events
Screenshot 2026-03-10 at 8 41 50 PM

@MaddieWright MaddieWright merged commit bc5f558 into main Mar 11, 2026
1 check failed
@MaddieWright MaddieWright deleted the frontend/websocket-fix branch March 11, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant