Reproduction steps
- Connect to the gateway with a bot token, Identify and wait for READY. Note
session_id,resume_gateway_urland the last sequence - Close the connection with code
1000 - Wait 2 seconds, connect to
resume_gateway_urland send Resume (opcode 6) - For comparison, repeat with close code
4000instead of1000
Expected behaviour
The session can be resumed. The docs say a session can be resumed "for 60,000 ms after any close, including a network failure or a normal
1000 or 1001 close" (opcodes-and-close-codes.md:82)Actual behaviour
After closing with
1000, Resume gets opcode 9 with d: false, so the session is gone. After closing with 4000, Resume works and gets RESUMED. Tested on wss://gateway.fluxer.com on 2026-11-03Platform
API
Evidence
Why it happens, at commit 5f3fc0b1:
- A client close with 1000 or 1001 exits the socket as
client_closed(gateway_handler.erl:257) - The session stops right away on
client_closedinstead of waiting for a resume (session_monitor.erl:68) - Every other close keeps the session for the resume timeout