fix(ws): add gateway close code 4013 (AckBackpressure) and mark as re…#24
fix(ws): add gateway close code 4013 (AckBackpressure) and mark as re…#24dogbonewish wants to merge 1 commit intofluxerjs:mainfrom
Conversation
|
@dogbonewish is attempting to deploy a commit to the blstmo's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request introduces support for WebSocket gateway close code 4013 (AckBackpressure) by adding the new code to the GatewayCloseCodes constant, integrating it into the shard reconnection logic to trigger automatic reconnection, and updating corresponding tests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
Description
The Fluxer gateway sends close code 4013 (
ack_backpressure) when the session'sevent acknowledgement buffer overflows (>4096 unacked events). This is a transient
condition and its safe to reconnect after, but shouldReconnectOnClose() doesn't include it, causing shards to silently die instead of auto-reconnecting.
This adds:
AckBackpressure: 4013toGatewayCloseCodescase 4013to shouldReconnectOnClose() so that the shard reconnects automaticallyRef:
fluxer_gateway/src/utils/constants.erlclose_code_to_num(ack_backpressure) -> 4013Type of change
Checklist
pnpm run lint)pnpm run buildsuccessfullypnpm run testsuccessfullySummary by CodeRabbit