diff --git a/assist/utils/httpHandlers.js b/assist/utils/httpHandlers.js index 500e4fdb5..67ffb4297 100644 --- a/assist/utils/httpHandlers.js +++ b/assist/utils/httpHandlers.js @@ -41,8 +41,8 @@ const respond = function (req, res, data) { RecordRequestDuration(req.method.toLowerCase(), res.handlerName, 200, duration/1000.0); } -const getParticularSession = async function (roomId, filters) { - let connected_sockets = await fetchSockets(roomId); +const getParticularSession = async function (roomId, filters, all=false) { + let connected_sockets = await fetchSockets(roomId, all); if (connected_sockets.length === 0) { return null; } @@ -172,7 +172,7 @@ const socketsLiveBySession = async function (req, res) { // find a particular session if (_sessionId) { - let sessInfo = await getParticularSession(`${_projectKey}-${_sessionId}`, filters); + let sessInfo = await getParticularSession(`${_projectKey}-${_sessionId}`, filters, true); return respond(req, res, sessInfo); } return respond(req, res, null); diff --git a/assist/utils/wsServer.js b/assist/utils/wsServer.js index e672a9f7e..e479769fe 100644 --- a/assist/utils/wsServer.js +++ b/assist/utils/wsServer.js @@ -11,7 +11,7 @@ function sendTo(to, eventName, ...data) { sendFrom(io, to, eventName, ...data); } -const fetchSockets = async function (roomID) { +const fetchSockets = async function (roomID, all=false) { if (!io) { return []; } diff --git a/ee/assist/utils/wsServer.js b/ee/assist/utils/wsServer.js index 3d99d16a0..2b7345868 100644 --- a/ee/assist/utils/wsServer.js +++ b/ee/assist/utils/wsServer.js @@ -61,7 +61,7 @@ function sendTo(to, eventName, ...data) { sendFrom(io, to, eventName, ...data); } -const fetchSockets = async function (roomID) { +const fetchSockets = async function (roomID, all=false) { if (!io) { return []; } @@ -69,7 +69,7 @@ const fetchSockets = async function (roomID) { return await doFetchAllSockets(); } try { - if (useStickySessions) { + if (useStickySessions && !all) { return await io.local.in(roomID).fetchSockets(); } else { return await io.in(roomID).fetchSockets();