From f66d155f083e0ab572c6ff8acd3e44f1ed5a5ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Mon, 21 Nov 2022 17:25:34 +0000 Subject: [PATCH] fix: only send the server version when the old poller is triggered by an 8.1+ machine --- lib/routes/pollingRoutes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/routes/pollingRoutes.js b/lib/routes/pollingRoutes.js index e0f4b4c2..5b00da23 100644 --- a/lib/routes/pollingRoutes.js +++ b/lib/routes/pollingRoutes.js @@ -81,6 +81,11 @@ function poll (req, res, next) { 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([ pi.recordPing(deviceTime, machineVersion, machineModel), pi.pollQueries(),