From 6fa5249656ec1185cfb48aac8eed1ac28fe1a83b Mon Sep 17 00:00:00 2001 From: you Date: Sun, 22 Mar 2026 23:35:10 +0000 Subject: [PATCH] Fix: pass sender lat/lon as origin anchor for hop disambiguation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADVERT packets have GPS coordinates — use them as the forward pass anchor so the first hop resolves to the nearest candidate to the sender, not random pick order. --- public/index.html | 2 +- public/packets.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index e0d97a1f..0577d1f3 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,7 @@ - + diff --git a/public/packets.js b/public/packets.js index 1080cc32..238d33f1 100644 --- a/public/packets.js +++ b/public/packets.js @@ -1100,10 +1100,12 @@ let pathHops; try { pathHops = JSON.parse(pkt.path_json || '[]'); } catch { pathHops = []; } - // Re-resolve hops with observer context for regional filtering - if (pathHops.length && pkt.observer_id) { + // Re-resolve hops with observer + sender location for regional filtering & disambiguation + if (pathHops.length) { await ensureHopResolver(); - const resolved = HopResolver.resolve(pathHops, null, null, null, null, pkt.observer_id); + const senderLat = decoded.lat || decoded.latitude || null; + const senderLon = decoded.lon || decoded.longitude || null; + const resolved = HopResolver.resolve(pathHops, senderLat, senderLon, null, null, pkt.observer_id); Object.assign(hopNameCache, resolved || {}); }