Add geofence validation, distance filtering, and debug mode#54
Merged
MrAlders0n merged 37 commits intomainfrom Dec 19, 2025
Merged
Add geofence validation, distance filtering, and debug mode#54MrAlders0n merged 37 commits intomainfrom
MrAlders0n merged 37 commits intomainfrom
Conversation
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Refactor and optimize wardrive.js with comprehensive debug logging
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…again Fix manual ping timeout after stopping auto ping
- Manual ping now shows "GPS data too old, requesting fresh position" when requesting fresh GPS - Manual ping shows "Error: could not get fresh GPS location" on timeout - Auto ping validates GPS freshness before sending - Auto ping shows "GPS data old, trying to refresh position" when refreshing - Auto ping shows "GPS could not refresh position, skipping ping. Next attempt (Xs)" on failure - Auto ping schedules next attempt when GPS refresh fails Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
- Created acquireFreshGpsPosition() helper to eliminate code duplication - Reduces duplication between auto and manual GPS acquisition - Improves code maintainability and readability Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…dback Add GPS status feedback and freshness validation for ping operations
- Add skipReason state to track when ping is skipped - Update countdown timer to support color-coded messages - Show "Ping skipped, gps too old. Waiting for next auto ping (Xs)" with live countdown - Clear skip reason on auto ping start/stop and next ping attempt - Display skip message in warning color to indicate issue Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Change from "Ping skipped, gps too old. Waiting for next auto ping (30s)" to "Skipped (gps too old), next ping (30s)" for more compact display Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Extract applyCountdownStatus helper function to handle both string and object return formats, reducing duplication in update() method Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Document applyCountdownStatus parameters and clarify skipReason is an internal value for security review Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…issue Add live countdown for GPS skip in auto-ping mode
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…nflict Fix auto ping timer conflict during manual ping
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…pings Add GPS geofence and distance-based ping filtering for Ottawa region
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Notes:
dev→mainHere's a detailed breakdown of all changes in the
devbranch that will be merged intomain:📄
.gitignoreAdded temporary files directory to ignore list:
# Temporary files tmp/📄
README.mdImproved setup instructions for both Android and iOS:
#wardrivingpublic hashtag channel in the MeshCore app before using the web app📄
index.htmlNew UI element - Added a "Distance from last ping" display row in the GPS info table:
📄
content/wardrive.js(Major changes)This is the bulk of the update with significant feature additions and refactoring:
🔧 Debug System
?debug=true)debugLog(),debugWarn(),debugError()helper functions🌍 Geofence Validation
validateGeofence()function using Haversine distance calculation📏 Distance-Based Ping Filtering
calculateHaversineDistance()function for accurate distance calculationsvalidateMinimumDistance()functionlastSuccessfulPingLocationfor distance comparisons⏱️ Countdown Timer Refactoring
createCountdownTimer()factory functionMIN_PAUSE_THRESHOLD_MS(1s),MAX_REASONABLE_TIMER_MS(5min) for clock skew handling🎨 Status Color System
STATUS_COLORSconstant object for consistent UI colors:idle: slate-300success: emerald-300warning: amber-300error: red-300info: sky-300📍 GPS Handling Improvements
GPS_WATCH_MAX_AGE_MSconstant (60s) for manual ping GPS data validationgetGpsCoordinatesForPing()function with better handling of GPS watch dataacquireFreshGpsPosition()helper function🔄 Skip Reason Tracking
state.skipReasonproperty to track why pings were skipped🧹 Code Organization
cleanupAllTimers()function for comprehensive timer cleanupscheduleApiPostAndMapRefresh()as a standalone functiongetDeviceIdentifier()helper functionlogPingToUI()helper function🐛 Bug Fixes & Improvements
getRemainingCooldownSeconds()helperSummary of Key New Features
?debug=trueURL parameter