Repository navigation
Update dependencies and handle WebSocket heartbeats - #193
Merged
Merged
Conversation
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@9c091bb...3d3c42e) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 5.4.0 to 6.0.0. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](actions/setup-dotnet@26b0ec1...a98b568) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.5.0 to 7.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@924ae3a...b7ad1da) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Adds a periodic heartbeat sender in `webchat.js` (configurable via `heartbeatIntervalMs`) and ensures heartbeat timers are started/stopped with socket lifecycle events. On the server side, `WebSocketChannel` now treats `heartbeat` envelopes as ignorable so they do not emit inbound user messages. Includes a new test to verify heartbeat envelopes are ignored.
Pass the connection request cancellation token through `InboundMessage` in `WebSocketChannel` so downstream handlers can observe client/request aborts. Adds a regression test to ensure the token is forwarded and remains cancellable.
Sanitize `heartbeatIntervalMs` by handling non-finite config values and clamping the result to a safe timer range (1000 to 2147483647 ms). This avoids invalid or overflow-prone intervals when reading `OPENCLAW_WEBCHAT_CONFIG`.
…ions/checkout-7.0.1 build(deps): bump actions/checkout from 7.0.0 to 7.0.1
…ions/setup-dotnet-6.0.0 build(deps): bump actions/setup-dotnet from 5.4.0 to 6.0.0
…ions/setup-go-7.0.0 build(deps): bump actions/setup-go from 6.5.0 to 7.0.0
Handle WebSocket heartbeats end-to-end
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
This pull request introduces a WebSocket heartbeat mechanism to improve connection reliability in the web chat, and updates the GitHub Actions workflows to use newer versions of the
actions/checkoutandactions/setup-dotnetactions. It also adds logic to ignore heartbeat messages on the server and tests to ensure correct handling of these cases.WebSocket Heartbeat Implementation and Handling:
webchat.jsthat periodically sends aheartbeatmessage to the server to keep the WebSocket connection alive. The heartbeat interval is configurable and the timer is properly started and cleared on connect/disconnect. [1] [2] [3] [4] [5] [6]WebSocketChannel.csto ignore incomingheartbeatenvelopes so they do not trigger message handling logic. Introduced theIsIgnorableClientEnvelopehelper for this purpose. [1] [2] [3] [4]Testing:
WebSocketChannelTests.csto verify that the request cancellation token is forwarded correctly and thatheartbeatenvelopes are ignored and do not result in user messages being processed. [1] [2]CI/CD Workflow Maintenance:
actions/checkoutin workflow YAML files to a newer commit for improved security and reliability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]actions/setup-dotnetandactions/setup-goto newer commits in workflow YAML files. [1] [2] [3] [4] [5] [6] [7] [8]These changes collectively enhance the reliability of WebSocket connections, ensure heartbeat messages are handled efficiently, and keep CI/CD dependencies up to date.