From ac10e813432ddf2f3d77c5efbc4ee7b9fec0c3b7 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Thu, 12 Dec 2024 14:14:20 +1300 Subject: [PATCH] fix bug where forgetting outdated node positions updated the updated_at column when the node never had a position --- src/mqtt.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mqtt.js b/src/mqtt.js index d667792..27df269 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -584,6 +584,13 @@ async function forgetOutdatedNodePositions() { // position_updated_at before x seconds ago lt: new Date(Date.now() - forgetOutdatedNodePositionsAfterSeconds * 1000), }, + // don't forget outdated node positions for nodes that don't actually have a position set + // otherwise the updated_at is updated, when nothing changed + NOT: { + latitude: null, + longitude: null, + altitude: null, + }, }, data: { latitude: null,