From 4a4b5fb7f32dca624d266511519aaf2d0eef9cfa Mon Sep 17 00:00:00 2001 From: Anton Roslund Date: Thu, 8 Jan 2026 20:58:46 +0100 Subject: [PATCH] Fix variable assignment in message handler to correctly identify fromNodeId and toNodeId for neighbor information extraction. --- src/mqtt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mqtt.js b/src/mqtt.js index f7bf9b5..67cb9dd 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -1096,7 +1096,7 @@ client.on("message", async (topic, message) => { // Extract edges from neighbour info try { - const fromNodeId = envelope.packet.from; + const toNodeId = envelope.packet.from; const neighbors = neighbourInfo.neighbors || []; const packetId = envelope.packet.id; const channelId = envelope.channelId; @@ -1115,7 +1115,7 @@ client.on("message", async (topic, message) => { continue; } - const toNodeId = neighbour.nodeId; + const fromNodeId = neighbour.nodeId; const snr = neighbour.snr; // Fetch node positions from Node table