Add transport status events#790
Merged
Merged
Conversation
Add symbol docs Emit transport status events Transport test suite
|
@philon- is attempting to deploy a commit to the Meshtastic Team on Vercel. A member of the Team first needs to authorize it. |
danditomaso
reviewed
Aug 19, 2025
danditomaso
reviewed
Aug 19, 2025
danditomaso
reviewed
Aug 19, 2025
72898aa to
7f2bd8d
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds transport status events across all transport implementations to provide better connection monitoring and debugging capabilities. It introduces a standardized approach for transports to emit connection status events through the device output stream.
- Adds
StatusEventpacket type toDeviceOutputand implements status event handling in the core packet decoder - Enhances all transport implementations to emit connection status events (connecting, connected, disconnected with reasons)
- Creates a comprehensive transport contract test suite with common test utilities for all transports
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/transportContract.ts | New shared test contract for validating transport implementations |
| packages/web/vitest.config.ts | Updated vitest configuration for better path resolution |
| packages/transport-web-serial/src/transport.ts | Added status events, improved error handling, and comprehensive documentation |
| packages/transport-web-serial/src/transport.test.ts | New test suite using transport contract |
| packages/transport-web-bluetooth/src/transport.ts | Added status events, improved connection lifecycle management |
| packages/transport-web-bluetooth/src/transport.test.ts | New test suite using transport contract |
| packages/transport-node/src/transport.ts | Added status events and improved error handling for TCP connections |
| packages/transport-node/src/transport.test.ts | New test suite using transport contract |
| packages/transport-node-serial/src/transport.ts | Added status events for serial port connections |
| packages/transport-node-serial/src/transport.test.ts | New test suite using transport contract |
| packages/transport-http/src/transport.ts | Enhanced HTTP transport with timeouts and status events |
| packages/transport-http/src/transport.test.ts | New test suite with timeout and polling tests |
| packages/core/src/utils/transform/decodePacket.ts | Added status event handling to packet decoder |
| packages/core/src/types.ts | Extended DeviceOutput with StatusEvent type |
| .vscode/settings.json | Added vitest workspace configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds transport status events, transport tests and transport symbol docs.
Related Issues
Changes Made
Tests:
pnpm run testin both./andpackages/web./tests/utils/transportContract.tshelper for common transport test cases (read/write, disconnect, link drop)core:
DeviceOutputwithStatusEventpacket typedevice.updateDeviceStatuswhich dispatchesonDeviceStatuseventstransport-http:
transport-node-serial:
transport-node:
transport-web-bluetooth:
transport-web-serial:
transport-deno has not been updated
Testing Done
Updated automated tests
Tested with HTTP, Web Serial and Web Bluetooth.
nodeJS transports have not been tested (other than with the automated tests)
Screenshots (if applicable)
Checklist
CONTRIBUTING_I18N_DEVELOPER_GUIDE.md for more details)