switch Socket.IO library
It seems in some events, each user will be twice in a room. It is unclear which event causes the user to re-join under a different user-id.
I haven't rule out yet that the underlying golang implementation of socket.io has some bugs. Maybe switching to https://github.com/Totodore/socketioxide is an option (which "looks" more robust and actively maintained).
The library you linked is a Rust library. Do you plan switching from Golang to Rust? 🥺
If that socket.io is really the culprit, then yes. 🦀 💪🏻
It seems that connection from client gets lost temporarily from time to time when there is a lot of events (some sort of throttling on the go side?)
Setting ConnectionStateRecovery option with a 3 to 5 seconds maxDisconnectionDuration seems to help to some degree but disconnects are still there.
@PatWie It so happened that I needed to implement something like this in my own project and I see how that can potentially benefit other people, so I plan to open-source my work. Would you like to join forces and contribute to that?
Mine is based off of tldraw whiteboard sdk as the frontend and custom multithreaded sync server written in go, connecting clients over websocket. It can currently sync multiple clients in real-time but lacks the ability to persist boards in any way yet or authenticate clients.
I haven't fully understood the issue or root-caused the problem. I switching to you library is fixing the issue, then of course the switch is more than welcome.
Just to be clear - this is not about "i have another backend for excalidraw in the works", but "i'm doing a similar thing from scratch and have the basics figured out". Is that ok with you?
I recommend vending your code as a library such that others can use it. I welcome all additions to the golang world. I'm not strictly tied to socket.io and am open to switching to a more robust solution if it addresses the issue effectively.
Honestly I don't see a problem using rust :)