fix: ensure buffered events are sent in order

Before this commit, an event sent in the "connect" handler could be
sent before the events that were buffered while disconnected.

Related: https://github.com/socketio/socket.io-client/issues/1458
This commit is contained in:
Damien Arrachequesne
2021-04-26 11:22:38 +02:00
parent 48fec45740
commit 4885e7d59f
2 changed files with 31 additions and 1 deletions

View File

@@ -367,8 +367,8 @@ public class Socket extends Emitter {
private void onconnect(String id) {
this.connected = true;
this.id = id;
super.emit(EVENT_CONNECT);
this.emitBuffered();
super.emit(EVENT_CONNECT);
}
private void emitBuffered() {