mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-08-28 22:18:25 +00:00
Fix: detail view always re-resolves hops fresh with sender GPS
List view resolves hops without anchor (no per-packet context). Detail view now always re-resolves with the packet's actual GPS coordinates + observer, overwriting stale cache entries. Removed debug logging.
This commit is contained in:
@@ -81,11 +81,8 @@ window.HopResolver = (function() {
|
||||
function resolve(hops, originLat, originLon, observerLat, observerLon, observerId) {
|
||||
if (!hops || !hops.length) return {};
|
||||
|
||||
console.log('[HopResolver] resolve:', { hops, originLat, originLon, observerId, iataCoords: Object.keys(iataCoords).length, observers: Object.keys(observerIataMap).length });
|
||||
|
||||
// Determine observer's IATA for regional filtering
|
||||
const packetIata = observerId ? observerIataMap[observerId] : null;
|
||||
if (observerId) console.log('[HopResolver] observer:', observerId.slice(0,12), '→ IATA:', packetIata);
|
||||
|
||||
const resolved = {};
|
||||
const hopPositions = {};
|
||||
|
||||
+2
-2
@@ -82,11 +82,11 @@
|
||||
<script src="vendor/qrcode.js"></script>
|
||||
<script src="roles.js?v=1774325000"></script>
|
||||
<script src="region-filter.js?v=1774325000"></script>
|
||||
<script src="hop-resolver.js?v=1774223093"></script>
|
||||
<script src="hop-resolver.js?v=1774223254"></script>
|
||||
<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=1774223207"></script>
|
||||
<script src="packets.js?v=1774223254"></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>
|
||||
|
||||
+9
-6
@@ -1100,14 +1100,17 @@
|
||||
let pathHops;
|
||||
try { pathHops = JSON.parse(pkt.path_json || '[]'); } catch { pathHops = []; }
|
||||
|
||||
// Re-resolve hops with observer + sender location for regional filtering & disambiguation
|
||||
// Re-resolve hops with sender location + observer — bypass stale cache
|
||||
if (pathHops.length) {
|
||||
await ensureHopResolver();
|
||||
const senderLat = (decoded.lat != null && decoded.lat !== 0) ? decoded.lat : (decoded.latitude || null);
|
||||
const senderLon = (decoded.lon != null && decoded.lon !== 0) ? decoded.lon : (decoded.longitude || null);
|
||||
console.log('[renderDetail] re-resolve:', { senderLat, senderLon, observer: pkt.observer_id?.slice(0,12), decodedKeys: Object.keys(decoded) });
|
||||
const resolved = HopResolver.resolve(pathHops, senderLat, senderLon, null, null, pkt.observer_id);
|
||||
Object.assign(hopNameCache, resolved || {});
|
||||
const senderLat = decoded.lat != null ? decoded.lat : (decoded.latitude || null);
|
||||
const senderLon = decoded.lon != null ? decoded.lon : (decoded.longitude || null);
|
||||
// Always re-resolve for detail view — list view may have cached without anchor
|
||||
const fresh = HopResolver.resolve(pathHops, senderLat, senderLon, null, null, pkt.observer_id);
|
||||
// Overwrite cache with better results
|
||||
for (const [k, v] of Object.entries(fresh || {})) {
|
||||
hopNameCache[k] = v;
|
||||
}
|
||||
}
|
||||
|
||||
// Parse hash size from path byte
|
||||
|
||||
Reference in New Issue
Block a user