You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@darrachequesne actually I was doing await socket.join("room-id"); where socket instanceof RemoteSocket and remote instance were notified about it, but problem is that await is not waiting
Yes you are right, with a RemoteSocket the socketsJoin() method does not currently wait for the acknowledgement of the other nodes of the cluster. That being said, the other nodes should receive the JOIN command first, and then the BROADCAST command, so it should work I guess.
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: