fix: only send the server version when the old poller is triggered by an 8.1+ machine

This commit is contained in:
Sérgio Salgado 2022-11-21 17:25:34 +00:00
parent 3d8d0d4f9c
commit f66d155f08

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(),