1984 Ford Laser
1984 Ford Laser
CDCloudflare Developers
Created by 1984 Ford Laser on 1/16/2025 in #durable-objects
Okay this is a dumb one, I think I fixed
This note in the docs might be of interest in this issue:
Disconnected WebSockets are not returned by this method, but getWebSockets may still return WebSockets even after ws.close has been called. For example, if the server-side WebSocket sends a close, but does not receive one back (and has not detected a disconnect from the client), then the connection is in the CLOSING 'readyState'. The client might send more messages, so the WebSocket is technically not disconnected.
Disconnected WebSockets are not returned by this method, but getWebSockets may still return WebSockets even after ws.close has been called. For example, if the server-side WebSocket sends a close, but does not receive one back (and has not detected a disconnect from the client), then the connection is in the CLOSING 'readyState'. The client might send more messages, so the WebSocket is technically not disconnected.
I currently don't do anything on the client-side to respond to server-executed close(), something in the docs on how to effectively do this would be great. I will repro this at a later date but just wanted to add to this so I don't forget
5 replies