#Websocket Hibernation DO + Vite local dev

2 messages · Page 1 of 1 (latest)

crimson jay
#

Hi all, im facing an issue and it’s making me pull my hair out

I’m currently writing a Vite app (React Router 7) , using cloudflare’s official vite adapter.
I’m enabling users to see who is connected to a given page (much like the tutorial on the cf docs itself)

But whenever i refresh, or leave the page, connections seem to linger and never close, so each refresh almost always leaves me with one more user than there was connected. Each refresh adds to the number of connections but does not remove the old ones.

Lots of tries to fix it in every possible way, but it did not work. There are lots of mdworker_shared processes created alongside the workerd instance when i check Activity Monitor, not sure that is relevant but there are like 20 of those all using 0 CPU

crimson jay
#

finding: it has something to do with disconnecting before a connection has been established, it does not clear it nor call websocketClose