Skip to content

Improve writer task management and update ProtocolRequestHandler#45

Merged
rightup merged 3 commits intopyMC-dev:feat/companionfrom
agessaman:dev-companion-v2
Mar 10, 2026
Merged

Improve writer task management and update ProtocolRequestHandler#45
rightup merged 3 commits intopyMC-dev:feat/companionfrom
agessaman:dev-companion-v2

Conversation

@agessaman
Copy link
Copy Markdown
Contributor

  • Updated ProtocolRequestHandler to support PATH responses for flood request packets, consistent with the firmware. This returns the same data, but also gives the client a out_path to the repeater for subsequent requests to use DIRECT.
  • Improved the task writer management to resolve issue #131 over on pyMC_repeater.
  • Added some tests to ensure we get the proper PATH vs. RESPONSE packets in various scenarios.

- Added cancellation and awaiting of the old writer task to ensure proper cleanup before creating a new task.
- Enhanced error handling to log exceptions from the writer task if it fails, improving debugging and stability during client disconnections.
- Refactored writer task management to use a local variable for improved readability and performance.
- Simplified the condition checks for the writer task's state, enhancing code clarity and maintainability.
…n receiving REQ via flood

- Updated response building logic to handle routing based on client out_path, ensuring correct packet types are returned.
- Enhanced tests for ProtocolRequestHandler to validate response generation under various scenarios, including flood and direct requests.
@rightup rightup merged commit 57ca8fb into pyMC-dev:feat/companion Mar 10, 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.

2 participants