Wocket Doesn't Send A `disconnect`Event When A Client Disconnects
ebebbington opened this issue · 0 comments
ebebbington commented
Summary
When a connected client (from the browser) connects to a websocket server that uses Wocket, everything is fine. But when the client disconnects (eg refreshes the page), the internals of Wocket. doesn't senda disconnect
event. But it. should because. it's part o f the. reserved event names. Eg:
// this is never called
wsServer.on("disconnect", (data: Packet) => {
})
Steps To Reproduce The Bug
- Create a websocket server using wocket
- Create handlers for the connect and disconnect events (add logging)
- Create a websocket client from the browser
- Refresh the page
- See that the
disconnect
handler is never called
Expected Behavior
When a client disconnects, the disconnect
event should be called
Suggested Solution(s)
Send this when there is a disconnection