fix(gateway): reset heartbeat ack state on reconnect#353
fix(gateway): reset heartbeat ack state on reconnect#353thewilloftheshadow merged 2 commits intobuape:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 03b7a8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughResets the gateway heartbeat acknowledgement state by setting Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
|
Thanks for the PR! |
Summary
Uncovered this when running my personal OpenClaw assistant using Discord as a channel for a bot: #353
#353
Have opened a downstream fix to harden their logic but also discovered some improvements for Carbon.
lastHeartbeatAckwhen a new heartbeat cycle starts instartHeartbeat(...)lastHeartbeatAckreset inGatewayPlugin.disconnect()Why
Issue #350 identified a stale heartbeat ACK state that can carry across reconnects and cause immediate reconnect churn on the first heartbeat of a new connection.
This PR fixes that state carryover directly in gateway heartbeat lifecycle.
Files changed
packages/carbon/src/plugins/gateway/utils/heartbeat.tspackages/carbon/src/plugins/gateway/GatewayPlugin.tspackages/carbon/tests/plugins/gateway-heartbeat.test.tsTests
Ran:
pnpm test packages/carbon/tests/plugins/gateway-heartbeat.test.tsResults:
Closes #350
Summary by CodeRabbit
Bug Fixes
Tests
Chores