-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
await socket.join is not waiting for other instances to have updated state #12
Comments
Hi! |
Hello, thank you for response. Then how can I notify other instances about socket joining some room? |
@darrachequesne actually I was doing |
Yes you are right, with a |
Before this change, the broadcast() method would send the BROADCAST command and then apply it locally (which is required to retrieve the offset of the message, when connection state recovery is enabled), while the other commands like disconnectSockets() would first apply it locally and then send the command to the other nodes. So, for example: ```js io.emit("bye"); io.disconnectSockets(); ``` In that case, the clients connected to the io instance would not receive the "bye" event, while the clients connected to the other server instances would receive it before being disconnected. Related: - socketio/socket.io-redis-streams-adapter#13 - socketio/socket.io-postgres-adapter#12
Hello, I am using Socket io v4 with Postgres adapter. All events are broadcasted and everything is working good except this case.
I have function that is joining room and exactly after that sending message.
I was actually trying to understand this adapter code and have feeling that await is not waiting for other instances of server to join room - that's why event is not broadcasted to all instances
The text was updated successfully, but these errors were encountered: