feat: socket.io 3 changes (#8845)

* feat: socket.io 3 changes

* feat: replace socketio-wildcard with socket.onAny

up socket.io-redis to 6.x

* feat: remove mongodb/psql socket.io adapters

* feat: show data on fail

* fix: tests

* fix: typo

* fix: logger test fix

* fix: logger.io_close

* chore: up deps

* chore: update readme to reflect redis requirement

* fix: increase timeout show data if test fails
This commit is contained in:
Barış Soner Uşaklı
2020-12-06 13:03:33 -05:00
committed by GitHub
parent d7f5efd960
commit 1c45fa1ba5
14 changed files with 69 additions and 146 deletions

View File

@@ -158,18 +158,15 @@ Logger.io_close = function (socket) {
return;
}
var clients = socket.io.sockets.sockets;
const clientsMap = socket.io.sockets.sockets;
for (var sid in clients) {
if (clients.hasOwnProperty(sid)) {
var client = clients[sid];
if (client.oEmit && client.oEmit !== client.emit) {
client.emit = client.oEmit;
}
for (const [, client] of clientsMap) {
if (client.oEmit && client.oEmit !== client.emit) {
client.emit = client.oEmit;
}
if (client.$onevent && client.$onevent !== client.onevent) {
client.onevent = client.$onevent;
}
if (client.$onevent && client.$onevent !== client.onevent) {
client.onevent = client.$onevent;
}
}
};
@@ -183,11 +180,9 @@ Logger.io = function (socket) {
return;
}
var clients = socket.io.sockets.sockets;
for (var sid in clients) {
if (clients.hasOwnProperty(sid)) {
Logger.io_one(clients[sid], clients[sid].uid);
}
const clientsMap = socket.io.sockets.sockets;
for (const [, socketObj] of clientsMap) {
Logger.io_one(socketObj, socketObj.uid);
}
};