Skip to content

Refactor to use API v2 Protocol Buffer Messages #613

Open
2 of 3 issues completed
Open
2 of 3 issues completed
@brentru

Description

@brentru

Replace existing protocol buffer message decoding and encoding implementations with an implementation compatible with api-v2 throughout the library. Also, update the function signatures and logic for encoding/decoding as needed.

The list of tasks below is subject to change during this process.

Documentation Tasks
I need to mentally untangle the codebase and map it out before I'm ready to refactor.

  • Document the location of each pb_encode/pb_decode call, what it specifically does, and where it is located.
  • Identify which PBs from api-v2 are not presenting any breaking changes
  • Identify which PBs from api-v2 will present breaking changes
  • Organize components with breaking changes from least impact to greatest
  • Identify which components we won't be touching or changing - things that don't have anything to do with the PBs.

Non-breaking, refactor Tasks

Refactor for "Top-Level Decoding" Logic
The new API switches us from listening to a unique mqtt topic per component to two "high-level mqtt topics" and a top-level pb message

  • Refactor registration process to use new check-in API #619
  • Replace old decoding logic with a new, top-level decoder. Similar to the "router" we used in WipperSnapper Python
  • Test w/protomq that the new top-level decoder properly sends messages to each of the component types
    • May require WITL (Wokwi in the Loop) testing to ensure each component type is successfully decoded

Refactor for "Top Level Encoding" Logic
Similar task to above, but in reverse for encoding

  • Replace old encoding logic with a new, top-level encoder.
  • Test w/protomq that the new top-level encoder properly sends messages to the broker
    • May require WITL (Wokwi in the Loop) testing to ensure each component type is successfully encoded

Update each component
Each component's decoder/encoder will need to be refactored to match the new top-level encoding/decoding logic, new MQTT topics, and refactored PB message structs

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions