Skip to content

Conversation

@adamshapiro0
Copy link
Collaborator

New Features

  • Added optional WebSocket transport support ws://HOSTNAME:PORT
    • Requires manual pip install websockets

Fixes

  • Fixed crash in NamedTupleAdapter when decoding already-translated values like enums (e.g., config response for TransportDirection)
  • Return a bytes object from FusionEngineDecoder if the message class has a parsing error instead of raising an exception
  • Fixed serial port baud specifier parsing

It the input to NamedTupleAdapter is not a construct Containers object, but is
something that has already been transformed from a Containers object (e.g.,
using AutoEnum to transform a Containers result to an enum), we need to use it
directly as input to the NamedTuple. It will not have a values() function.
@adamshapiro0 adamshapiro0 requested a review from wbrannon July 18, 2025 21:48
@adamshapiro0 adamshapiro0 self-assigned this Jul 18, 2025
@anathan anathan requested a review from Copilot July 19, 2025 05:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds optional WebSocket transport support and fixes several bugs related to message parsing and transport handling. The changes enable WebSocket connections for the Fusion Engine client while maintaining backward compatibility for installations without the websockets library.

  • Added WebSocket transport support with ws:// protocol handling and optional dependency management
  • Fixed NamedTupleAdapter crash when processing already-translated enum values
  • Modified error handling in FusionEngineDecoder to return raw bytes instead of raising exceptions on parsing failures

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
python/fusion_engine_client/utils/transport_utils.py Adds WebSocket transport support, improves serial port regex parsing, and reorganizes optional dependency handling
python/fusion_engine_client/utils/construct_utils.py Fixes NamedTupleAdapter._decode() to handle both Container objects and already-translated values
python/fusion_engine_client/parsers/decoder.py Changes error handling to return raw bytes instead of continuing the parsing loop when message deserialization fails

Copy link
Contributor

@wbrannon wbrannon left a comment

Choose a reason for hiding this comment

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

Looks good.

@adamshapiro0 adamshapiro0 merged commit c86a26f into master Jul 21, 2025
14 checks passed
@adamshapiro0 adamshapiro0 deleted the fix-tuple-adapter branch July 21, 2025 17:28
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