Skip to content

Fix Python client compatibility with ROUTER-based control messages#317

Closed
Copilot wants to merge 3 commits intofix/transform-sub-drain-rcvhwmfrom
copilot/sub-pr-316
Closed

Fix Python client compatibility with ROUTER-based control messages#317
Copilot wants to merge 3 commits intofix/transform-sub-drain-rcvhwmfrom
copilot/sub-pr-316

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

The protocol change moving control messages from PUB/SUB to ROUTER/DEALER broke the Python client, which only polled the SUB socket. The client couldn't receive RPC, Network Variables, or Device ID mappings, but tests passed due to missing assertions.

Changes

Python Client (client.py)

  • Poll both DEALER and SUB sockets in receive loop
  • DEALER receives control messages (RPC, NV, Device ID mappings) from ROUTER
  • SUB receives transform broadcasts from PUB
  • Auto-send stealth handshake on start to register with server

Binary Serializer (binary_serializer.py)

  • Fixed device ID mapping deserializer to skip 3-byte version header
  • Pre-existing bug exposed by protocol change

Example

Before (broken):

# Only SUB socket polled
poller = zmq.Poller()
if self._sub_socket:
    poller.register(self._sub_socket, zmq.POLLIN)

After (fixed):

# Both sockets polled
poller = zmq.Poller()
if self._sub_socket:
    poller.register(self._sub_socket, zmq.POLLIN)
if self._dealer_socket:
    poller.register(self._dealer_socket, zmq.POLLIN)  # Control messages

# Handle DEALER messages
if self._dealer_socket in socks:
    message_parts = self._dealer_socket.recv_multipart()
    self._process_message(message_parts[1])  # [room_id, payload]

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 28, 2026 12:13
- Poll both DEALER and SUB sockets in receive loop
- DEALER receives control messages (RPC, NV, device mapping) from ROUTER
- SUB receives transform broadcasts from PUB
- Auto-send stealth handshake on start to register with server
- Fix device ID mapping deserializer to skip 3-byte version header

This resolves the protocol breaking change introduced when control messages
were moved from PUB/SUB to ROUTER/DEALER unicast delivery.

Co-authored-by: from2001 <387880+from2001@users.noreply.github.com>
- Move stealth handshake send after logger to avoid race condition
- Make error handling consistent between DEALER and SUB socket processing

Co-authored-by: from2001 <387880+from2001@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor NetSyncServer and ConnectionManager for priority-based sending Fix Python client compatibility with ROUTER-based control messages Jan 28, 2026
Copilot AI requested a review from from2001 January 28, 2026 12:20
@from2001 from2001 closed this Jan 28, 2026
@from2001 from2001 deleted the copilot/sub-pr-316 branch January 28, 2026 12:29
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