Merge pull request #1451 from chaotixkilla/fix-send-only-server-version-old-poller

Only send the server version to the old poller requests by 8.1+ machines
This commit is contained in:
Rafael Taranto 2022-11-28 12:41:14 +00:00 committed by GitHub
commit f4fa98879f

View file

@ -81,6 +81,11 @@ function poll (req, res, next) {
state.pids = _.update(operatorId, _.set(deviceId, { pid, ts: Date.now() }), state.pids) state.pids = _.update(operatorId, _.set(deviceId, { pid, ts: Date.now() }), state.pids)
// BACKWARDS_COMPATIBILITY 8.1
// Machines after 8.1 only need the server version from the initial polling request.
if (semver.gte(machineVersion, '8.1.0-beta.0'))
return res.json({ version })
return Promise.all([ return Promise.all([
pi.recordPing(deviceTime, machineVersion, machineModel), pi.recordPing(deviceTime, machineVersion, machineModel),
pi.pollQueries(), pi.pollQueries(),