Fix: pass sender lat/lon as origin anchor for hop disambiguation

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.
This commit is contained in:
you committed 2026-03-22 23:35:10 +00:00
1 parent 3a7fb77552
commit 6fa5249656
2 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -86,7 +86,7 @@
<script src="hop-display.js?v=1774221932"></script>
<script src="app.js?v=1774126708"></script>
<script src="home.js?v=1774042199"></script>
<script src="packets.js?v=1774222186"></script>
<script src="packets.js?v=1774222510"></script>
<script src="map.js?v=1774220756" onerror="console.error('Failed to load:', this.src)"></script>
<script src="channels.js?v=1774331200" onerror="console.error('Failed to load:', this.src)"></script>
<script src="nodes.js?v=1774221131" onerror="console.error('Failed to load:', this.src)"></script>
+5 -3
View File
@@ -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 || {});
}