Skip to content

fix(discord): reset ACK state for new heartbeat cycles - #43

Open
lyrishark wants to merge 1 commit into
PsycherosAI:mainfrom
lyrishark:agent/discord-heartbeat-fresh-cycle
Open

fix(discord): reset ACK state for new heartbeat cycles#43
lyrishark wants to merge 1 commit into
PsycherosAI:mainfrom
lyrishark:agent/discord-heartbeat-fresh-cycle

Conversation

@lyrishark

Copy link
Copy Markdown

Summary

  • reset the heartbeat ACK sentinel whenever Discord sends HELLO and a new heartbeat cycle begins
  • prevent a missed ACK on the replaced socket from immediately closing the resumed socket before its first heartbeat
  • add a focused regression test

Closes #42.

Verification

  • deno fmt --check packages/psycheros/src/discord/gateway.ts packages/psycheros/tests/discord_gateway_heartbeat_test.ts
  • deno check --config packages/psycheros/deno.json packages/psycheros/src/discord/gateway.ts packages/psycheros/tests/discord_gateway_heartbeat_test.ts
  • deno test --config packages/psycheros/deno.json -A packages/psycheros/tests/discord_gateway_heartbeat_test.ts

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.

Discord gateway can enter an endless reconnect loop after one missed heartbeat ACK

1 participant