From 8848c5b3917496b09fa19f40af43f495c5bb12c0 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 29 Jul 2025 11:57:41 -0500 Subject: [PATCH 1/2] Fix packet spidering to only include most recent markers with icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OverlappingMarkerSpiderfier (OMS) was incorrectly configured to exclude historical markers but wasn't properly filtering for only the most recent packets with icons. This caused spidering functionality to break. Changes: - Updated addMarker() to check data.is_most_recent_for_callsign instead of \!_isHistorical - Updated zoom handler to check markerState.is_most_recent_for_callsign when re-adding markers to OMS - Ensures only current position markers (with APRS icons) participate in spidering - Historical markers (red dots) are excluded from spidering as intended 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- assets/js/map.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/js/map.ts b/assets/js/map.ts index 2dd3c88..b3ad99d 100644 --- a/assets/js/map.ts +++ b/assets/js/map.ts @@ -502,8 +502,10 @@ let MapAPRSMap = { if (self.oms) { // Clear and re-add all markers to OMS on zoom change self.oms.clearMarkers(); - self.markers.forEach((marker) => { - if (marker && !marker._isHistorical && !marker._isClusterMarker) { + self.markers.forEach((marker, id) => { + const markerState = self.markerStates.get(String(id)); + // Only add most recent markers (those with icons) to OMS for spidering + if (marker && !marker._isClusterMarker && markerState && markerState.is_most_recent_for_callsign) { self.oms.addMarker(marker); } }); @@ -1547,8 +1549,8 @@ let MapAPRSMap = { marker.openPopup(); } - // Add to OMS for overlapping marker handling (only non-historical markers) - if (self.oms && marker && self.map && !marker._isClusterMarker && !(marker as APRSMarker)._isHistorical) { + // Add to OMS for overlapping marker handling (only most recent packets with icons) + if (self.oms && marker && self.map && !marker._isClusterMarker && data.is_most_recent_for_callsign) { self.oms.addMarker(marker); } }, From 850498c50b62121072f1a03f06b70f13b8e7f2da Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 29 Jul 2025 12:00:49 -0500 Subject: [PATCH 2/2] Add defensive checks for is_most_recent_for_callsign property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improves robustness by adding fallback logic when is_most_recent_for_callsign is undefined or null. In edge cases where this server-side property might not be reliably set, falls back to the previous behavior of excluding historical markers using the _isHistorical flag. Changes: - Added explicit boolean checks for is_most_recent_for_callsign === true - Added fallback logic: if property is null/undefined, use \!_isHistorical - Applied to both addMarker() and zoom handler functions - Ensures spidering works even if server-side property is inconsistent 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- assets/js/map.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/js/map.ts b/assets/js/map.ts index b3ad99d..3af2d3a 100644 --- a/assets/js/map.ts +++ b/assets/js/map.ts @@ -505,7 +505,10 @@ let MapAPRSMap = { self.markers.forEach((marker, id) => { const markerState = self.markerStates.get(String(id)); // Only add most recent markers (those with icons) to OMS for spidering - if (marker && !marker._isClusterMarker && markerState && markerState.is_most_recent_for_callsign) { + // Fallback: if is_most_recent_for_callsign is undefined, exclude historical markers as before + const shouldAddToOms = markerState?.is_most_recent_for_callsign === true || + (markerState?.is_most_recent_for_callsign == null && !marker._isHistorical); + if (marker && !marker._isClusterMarker && markerState && shouldAddToOms) { self.oms.addMarker(marker); } }); @@ -1550,7 +1553,10 @@ let MapAPRSMap = { } // Add to OMS for overlapping marker handling (only most recent packets with icons) - if (self.oms && marker && self.map && !marker._isClusterMarker && data.is_most_recent_for_callsign) { + // Fallback: if is_most_recent_for_callsign is undefined, exclude historical markers as before + const shouldAddToOms = data.is_most_recent_for_callsign === true || + (data.is_most_recent_for_callsign == null && !(marker as APRSMarker)._isHistorical); + if (self.oms && marker && self.map && !marker._isClusterMarker && shouldAddToOms) { self.oms.addMarker(marker); } },